-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add uitests for cargo rust-version field
- Loading branch information
Showing
33 changed files
with
282 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "fail-both-diff" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.56" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.59" |
11 changes: 11 additions & 0 deletions
11
tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
tests/ui-cargo/cargo_rust_version/fail_both_diff/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.59.0` | ||
|
||
error: unnecessary structure name repetition | ||
--> $DIR/main.rs:6:21 | ||
| | ||
LL | pub fn bar() -> Foo { | ||
| ^^^ help: use the applicable keyword: `Self` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/main.rs:1:9 | ||
| | ||
LL | #![deny(clippy::use_self)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "fail-both-same" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.57.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.57" |
11 changes: 11 additions & 0 deletions
11
tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui-cargo/cargo_rust_version/fail_both_same/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: unnecessary structure name repetition | ||
--> $DIR/main.rs:6:21 | ||
| | ||
LL | pub fn bar() -> Foo { | ||
| ^^^ help: use the applicable keyword: `Self` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/main.rs:1:9 | ||
| | ||
LL | #![deny(clippy::use_self)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "fail-cargo" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.56.1" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui-cargo/cargo_rust_version/fail_cargo/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: unnecessary structure name repetition | ||
--> $DIR/main.rs:6:21 | ||
| | ||
LL | pub fn bar() -> Foo { | ||
| ^^^ help: use the applicable keyword: `Self` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/main.rs:1:9 | ||
| | ||
LL | #![deny(clippy::use_self)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "fail-clippy" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.58" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui-cargo/cargo_rust_version/fail_clippy/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: unnecessary structure name repetition | ||
--> $DIR/main.rs:6:21 | ||
| | ||
LL | pub fn bar() -> Foo { | ||
| ^^^ help: use the applicable keyword: `Self` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/main.rs:1:9 | ||
| | ||
LL | #![deny(clippy::use_self)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "fail-file-attr" | ||
version = "0.1.0" | ||
rust-version = "1.13" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.13.0" |
13 changes: 13 additions & 0 deletions
13
tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![feature(custom_inner_attributes)] | ||
#![clippy::msrv = "1.58.0"] | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui-cargo/cargo_rust_version/fail_file_attr/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: unnecessary structure name repetition | ||
--> $DIR/main.rs:8:21 | ||
| | ||
LL | pub fn bar() -> Foo { | ||
| ^^^ help: use the applicable keyword: `Self` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/main.rs:3:9 | ||
| | ||
LL | #![deny(clippy::use_self)] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "fail-both-same" | ||
version = "0.1.0" | ||
rust-version = "1.13.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.13" |
11 changes: 11 additions & 0 deletions
11
tests/ui-cargo/cargo_rust_version/pass_both_same/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "fail-cargo" | ||
version = "0.1.0" | ||
rust-version = "1.13.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "fail-clippy" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "fail-file-attr" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.59" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
13 changes: 13 additions & 0 deletions
13
tests/ui-cargo/cargo_rust_version/pass_file_attr/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![feature(custom_inner_attributes)] | ||
#![clippy::msrv = "1.13.0"] | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "warn-both-diff" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.56.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
msrv = "1.13" |
11 changes: 11 additions & 0 deletions
11
tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![deny(clippy::use_self)] | ||
|
||
pub struct Foo; | ||
|
||
impl Foo { | ||
pub fn bar() -> Foo { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
4 changes: 4 additions & 0 deletions
4
tests/ui-cargo/cargo_rust_version/warn_both_diff/src/main.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.13.0` | ||
|
||
warning: 1 warning emitted | ||
|