Skip to content

Commit 8a161d7

Browse files
committed
Add run-rustfix for rename test
I removed the `Bar` static and `Foo` impl because they are not needed for what's tested here as far as I can tell.
1 parent dea92fa commit 8a161d7

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

tests/ui/rename.fixed

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! Test for Clippy lint renames.
2+
// run-rustfix
3+
4+
#![allow(dead_code)]
5+
// allow the new lint name here, to test if the new name works
6+
#![allow(clippy::module_name_repetitions)]
7+
#![allow(clippy::new_without_default)]
8+
#![allow(clippy::cognitive_complexity)]
9+
#![allow(clippy::redundant_static_lifetimes)]
10+
// warn for the old lint name here, to test if the renaming worked
11+
#![warn(clippy::cognitive_complexity)]
12+
13+
#[warn(clippy::module_name_repetitions)]
14+
fn main() {}
15+
16+
#[warn(clippy::new_without_default)]
17+
struct Foo;
18+
19+
#[warn(clippy::redundant_static_lifetimes)]
20+
fn foo() {}

tests/ui/rename.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Test for Clippy lint renames.
2+
// run-rustfix
23

4+
#![allow(dead_code)]
35
// allow the new lint name here, to test if the new name works
46
#![allow(clippy::module_name_repetitions)]
57
#![allow(clippy::new_without_default)]
@@ -15,10 +17,4 @@ fn main() {}
1517
struct Foo;
1618

1719
#[warn(clippy::const_static_lifetime)]
18-
static Bar: &'static str = "baz";
19-
20-
impl Foo {
21-
fn new() -> Self {
22-
Foo
23-
}
24-
}
20+
fn foo() {}

tests/ui/rename.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
2-
--> $DIR/rename.rs:9:9
2+
--> $DIR/rename.rs:11:9
33
|
44
LL | #![warn(clippy::cyclomatic_complexity)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
66
|
77
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
88

99
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
10-
--> $DIR/rename.rs:11:8
10+
--> $DIR/rename.rs:13:8
1111
|
1212
LL | #[warn(clippy::stutter)]
1313
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
1414

1515
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
16-
--> $DIR/rename.rs:14:8
16+
--> $DIR/rename.rs:16:8
1717
|
1818
LL | #[warn(clippy::new_without_default_derive)]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
2020

2121
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
22-
--> $DIR/rename.rs:17:8
22+
--> $DIR/rename.rs:19:8
2323
|
2424
LL | #[warn(clippy::const_static_lifetime)]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
2626

2727
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
28-
--> $DIR/rename.rs:9:9
28+
--> $DIR/rename.rs:11:9
2929
|
3030
LL | #![warn(clippy::cyclomatic_complexity)]
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`

0 commit comments

Comments
 (0)