Skip to content

Commit 7e07d1b

Browse files
committed
Restructure rename tests
1 parent fefa7e7 commit 7e07d1b

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

tests/ui/rename.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
#![allow(stutter)]
1+
//! Test for Clippy lint renames.
2+
3+
// allow the new lint name here, to test if the new name works
4+
#![allow(clippy::module_name_repetitions)]
5+
#![allow(clippy::new_without_default)]
6+
#![allow(clippy::cognitive_complexity)]
7+
#![allow(clippy::redundant_static_lifetimes)]
8+
// warn for the old lint name here, to test if the renaming worked
29
#![warn(clippy::cyclomatic_complexity)]
310

411
#[warn(clippy::stutter)]

tests/ui/rename.stderr

+6-28
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,34 @@
1-
error: unknown lint: `stutter`
2-
--> $DIR/rename.rs:1:10
3-
|
4-
LL | #![allow(stutter)]
5-
| ^^^^^^^
6-
|
7-
= note: `-D unknown-lints` implied by `-D warnings`
8-
91
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
10-
--> $DIR/rename.rs:2:9
2+
--> $DIR/rename.rs:9:9
113
|
124
LL | #![warn(clippy::cyclomatic_complexity)]
135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
146
|
157
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
168

179
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
18-
--> $DIR/rename.rs:4:8
10+
--> $DIR/rename.rs:11:8
1911
|
2012
LL | #[warn(clippy::stutter)]
2113
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
2214

2315
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
24-
--> $DIR/rename.rs:7:8
16+
--> $DIR/rename.rs:14:8
2517
|
2618
LL | #[warn(clippy::new_without_default_derive)]
2719
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
2820

2921
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
30-
--> $DIR/rename.rs:10:8
22+
--> $DIR/rename.rs:17:8
3123
|
3224
LL | #[warn(clippy::const_static_lifetime)]
3325
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
3426

35-
error: unknown lint: `stutter`
36-
--> $DIR/rename.rs:1:10
37-
|
38-
LL | #![allow(stutter)]
39-
| ^^^^^^^
40-
4127
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
42-
--> $DIR/rename.rs:2:9
28+
--> $DIR/rename.rs:9:9
4329
|
4430
LL | #![warn(clippy::cyclomatic_complexity)]
4531
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
4632

47-
error: Statics have by default a `'static` lifetime
48-
--> $DIR/rename.rs:11:14
49-
|
50-
LL | static Bar: &'static str = "baz";
51-
| -^^^^^^^---- help: consider removing `'static`: `&str`
52-
|
53-
= note: `-D clippy::redundant-static-lifetimes` implied by `-D warnings`
54-
55-
error: aborting due to 8 previous errors
33+
error: aborting due to 5 previous errors
5634

0 commit comments

Comments
 (0)