Skip to content

Commit f0a1cd5

Browse files
committed
add uitests for cargo rust-version field
1 parent 6384765 commit f0a1cd5

File tree

33 files changed

+278
-0
lines changed

33 files changed

+278
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-both-diff"
3+
version = "0.1.0"
4+
rust-version = "1.56"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.59"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.59.0` from `clippy.toml`
2+
3+
error: unnecessary structure name repetition
4+
--> $DIR/main.rs:6:21
5+
|
6+
LL | pub fn bar() -> Foo {
7+
| ^^^ help: use the applicable keyword: `Self`
8+
|
9+
note: the lint level is defined here
10+
--> $DIR/main.rs:1:9
11+
|
12+
LL | #![deny(clippy::use_self)]
13+
| ^^^^^^^^^^^^^^^^
14+
15+
error: aborting due to previous error; 1 warning emitted
16+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-both-same"
3+
version = "0.1.0"
4+
rust-version = "1.57.0"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.57"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unnecessary structure name repetition
2+
--> $DIR/main.rs:6:21
3+
|
4+
LL | pub fn bar() -> Foo {
5+
| ^^^ help: use the applicable keyword: `Self`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/main.rs:1:9
9+
|
10+
LL | #![deny(clippy::use_self)]
11+
| ^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-cargo"
3+
version = "0.1.0"
4+
rust-version = "1.56.1"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unnecessary structure name repetition
2+
--> $DIR/main.rs:6:21
3+
|
4+
LL | pub fn bar() -> Foo {
5+
| ^^^ help: use the applicable keyword: `Self`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/main.rs:1:9
9+
|
10+
LL | #![deny(clippy::use_self)]
11+
| ^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "fail-clippy"
3+
version = "0.1.0"
4+
5+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
6+
7+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.58"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unnecessary structure name repetition
2+
--> $DIR/main.rs:6:21
3+
|
4+
LL | pub fn bar() -> Foo {
5+
| ^^^ help: use the applicable keyword: `Self`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/main.rs:1:9
9+
|
10+
LL | #![deny(clippy::use_self)]
11+
| ^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-file-attr"
3+
version = "0.1.0"
4+
rust-version = "1.13"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.13.0"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// FIXME: this should produce a warning, because the attribute says 1.58 and the cargo.toml file
2+
// says 1.13
3+
4+
#![feature(custom_inner_attributes)]
5+
#![clippy::msrv = "1.58.0"]
6+
#![deny(clippy::use_self)]
7+
8+
pub struct Foo;
9+
10+
impl Foo {
11+
pub fn bar() -> Foo {
12+
Foo
13+
}
14+
}
15+
16+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unnecessary structure name repetition
2+
--> $DIR/main.rs:11:21
3+
|
4+
LL | pub fn bar() -> Foo {
5+
| ^^^ help: use the applicable keyword: `Self`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/main.rs:6:9
9+
|
10+
LL | #![deny(clippy::use_self)]
11+
| ^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-both-same"
3+
version = "0.1.0"
4+
rust-version = "1.13.0"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.13"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-cargo"
3+
version = "0.1.0"
4+
rust-version = "1.13.0"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "fail-clippy"
3+
version = "0.1.0"
4+
5+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
6+
7+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.13"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "fail-file-attr"
3+
version = "0.1.0"
4+
rust-version = "1.59"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(custom_inner_attributes)]
2+
#![clippy::msrv = "1.13.0"]
3+
#![deny(clippy::use_self)]
4+
5+
pub struct Foo;
6+
7+
impl Foo {
8+
pub fn bar() -> Foo {
9+
Foo
10+
}
11+
}
12+
13+
fn main() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "warn-both-diff"
3+
version = "0.1.0"
4+
rust-version = "1.56.0"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.13"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![deny(clippy::use_self)]
2+
3+
pub struct Foo;
4+
5+
impl Foo {
6+
pub fn bar() -> Foo {
7+
Foo
8+
}
9+
}
10+
11+
fn main() {}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
warning: the MSRV in `clippy.toml` and `Cargo.toml` differ; using `1.13.0` from `clippy.toml`
2+
3+
warning: 1 warning emitted
4+

0 commit comments

Comments
 (0)