Skip to content

Commit a48367e

Browse files
committed
Auto merge of rust-lang#7884 - devonhollowood:rename-cleanup, r=xFrednet
Clean up tests/ui/rename.rs Part one of rust-lang#7057, cleaning up `tests/ui/rename.rs`. `tests/ui/deprecated.rs` will be updated in a subsequent PR. changelog: none
2 parents 0d07ec1 + ab9a8f2 commit a48367e

File tree

4 files changed

+270
-33
lines changed

4 files changed

+270
-33
lines changed

clippy_lints/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ fn register_removed_non_tool_lints(store: &mut rustc_lint::LintStore) {
828828
///
829829
/// Used in `./src/driver.rs`.
830830
pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
831+
// NOTE: when renaming a lint, add a corresponding test to tests/ui/rename.rs
831832
ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
832833
ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
833834
ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");

tests/ui/rename.fixed

+50-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,58 @@
66
#![allow(clippy::module_name_repetitions)]
77
#![allow(clippy::new_without_default)]
88
#![allow(clippy::redundant_static_lifetimes)]
9+
#![allow(clippy::bind_instead_of_map)]
10+
#![allow(clippy::box_collection)]
11+
#![allow(clippy::blocks_in_if_conditions)]
12+
#![allow(clippy::map_unwrap_or)]
13+
#![allow(clippy::unwrap_used)]
14+
#![allow(clippy::expect_used)]
15+
#![allow(clippy::for_loops_over_fallibles)]
16+
#![allow(clippy::useless_conversion)]
17+
#![allow(clippy::invisible_characters)]
18+
#![allow(clippy::single_char_add_str)]
19+
#![allow(clippy::match_result_ok)]
20+
// uplifted lints
21+
#![allow(invalid_value)]
22+
#![allow(array_into_iter)]
23+
#![allow(unused_labels)]
24+
#![allow(drop_bounds)]
25+
#![allow(temporary_cstring_as_ptr)]
26+
#![allow(non_fmt_panics)]
27+
#![allow(unknown_lints)]
28+
#![allow(invalid_atomic_ordering)]
29+
#![allow(enum_intrinsics_non_enums)]
930
// warn for the old lint name here, to test if the renaming worked
31+
#![warn(clippy::module_name_repetitions)]
32+
#![warn(clippy::new_without_default)]
33+
#![warn(clippy::redundant_static_lifetimes)]
1034
#![warn(clippy::cognitive_complexity)]
35+
#![warn(clippy::bind_instead_of_map)]
36+
#![warn(clippy::box_collection)]
37+
#![warn(clippy::blocks_in_if_conditions)]
38+
#![warn(clippy::blocks_in_if_conditions)]
39+
#![warn(clippy::map_unwrap_or)]
40+
#![warn(clippy::map_unwrap_or)]
41+
#![warn(clippy::map_unwrap_or)]
42+
#![warn(clippy::unwrap_used)]
43+
#![warn(clippy::unwrap_used)]
44+
#![warn(clippy::expect_used)]
45+
#![warn(clippy::expect_used)]
46+
#![warn(clippy::for_loops_over_fallibles)]
47+
#![warn(clippy::for_loops_over_fallibles)]
48+
#![warn(clippy::useless_conversion)]
49+
#![warn(clippy::invisible_characters)]
50+
#![warn(clippy::single_char_add_str)]
51+
#![warn(clippy::match_result_ok)]
52+
// uplifted lints
53+
#![warn(invalid_value)]
54+
#![warn(array_into_iter)]
55+
#![warn(unused_labels)]
56+
#![warn(drop_bounds)]
57+
#![warn(temporary_cstring_as_ptr)]
58+
#![warn(non_fmt_panics)]
59+
#![warn(unknown_lints)]
60+
#![warn(invalid_atomic_ordering)]
1161
#![warn(enum_intrinsics_non_enums)]
1262

13-
#[warn(clippy::module_name_repetitions)]
1463
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

+50-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,58 @@
66
#![allow(clippy::module_name_repetitions)]
77
#![allow(clippy::new_without_default)]
88
#![allow(clippy::redundant_static_lifetimes)]
9+
#![allow(clippy::bind_instead_of_map)]
10+
#![allow(clippy::box_collection)]
11+
#![allow(clippy::blocks_in_if_conditions)]
12+
#![allow(clippy::map_unwrap_or)]
13+
#![allow(clippy::unwrap_used)]
14+
#![allow(clippy::expect_used)]
15+
#![allow(clippy::for_loops_over_fallibles)]
16+
#![allow(clippy::useless_conversion)]
17+
#![allow(clippy::invisible_characters)]
18+
#![allow(clippy::single_char_add_str)]
19+
#![allow(clippy::match_result_ok)]
20+
// uplifted lints
21+
#![allow(invalid_value)]
22+
#![allow(array_into_iter)]
23+
#![allow(unused_labels)]
24+
#![allow(drop_bounds)]
25+
#![allow(temporary_cstring_as_ptr)]
26+
#![allow(non_fmt_panics)]
27+
#![allow(unknown_lints)]
28+
#![allow(invalid_atomic_ordering)]
29+
#![allow(enum_intrinsics_non_enums)]
930
// warn for the old lint name here, to test if the renaming worked
31+
#![warn(clippy::stutter)]
32+
#![warn(clippy::new_without_default_derive)]
33+
#![warn(clippy::const_static_lifetime)]
1034
#![warn(clippy::cyclomatic_complexity)]
35+
#![warn(clippy::option_and_then_some)]
36+
#![warn(clippy::box_vec)]
37+
#![warn(clippy::block_in_if_condition_expr)]
38+
#![warn(clippy::block_in_if_condition_stmt)]
39+
#![warn(clippy::option_map_unwrap_or)]
40+
#![warn(clippy::option_map_unwrap_or_else)]
41+
#![warn(clippy::result_map_unwrap_or_else)]
42+
#![warn(clippy::option_unwrap_used)]
43+
#![warn(clippy::result_unwrap_used)]
44+
#![warn(clippy::option_expect_used)]
45+
#![warn(clippy::result_expect_used)]
46+
#![warn(clippy::for_loop_over_option)]
47+
#![warn(clippy::for_loop_over_result)]
48+
#![warn(clippy::identity_conversion)]
49+
#![warn(clippy::zero_width_space)]
50+
#![warn(clippy::single_char_push_str)]
51+
#![warn(clippy::if_let_some_result)]
52+
// uplifted lints
53+
#![warn(clippy::invalid_ref)]
54+
#![warn(clippy::into_iter_on_array)]
55+
#![warn(clippy::unused_label)]
56+
#![warn(clippy::drop_bounds)]
57+
#![warn(clippy::temporary_cstring_as_ptr)]
58+
#![warn(clippy::panic_params)]
59+
#![warn(clippy::unknown_clippy_lints)]
60+
#![warn(clippy::invalid_atomic_ordering)]
1161
#![warn(clippy::mem_discriminant_non_enum)]
1262

13-
#[warn(clippy::stutter)]
1463
fn main() {}
15-
16-
#[warn(clippy::new_without_default_derive)]
17-
struct Foo;
18-
19-
#[warn(clippy::const_static_lifetime)]
20-
fn foo() {}

tests/ui/rename.stderr

+169-19
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,184 @@
1+
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
2+
--> $DIR/rename.rs:31:9
3+
|
4+
LL | #![warn(clippy::stutter)]
5+
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
6+
|
7+
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
8+
9+
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
10+
--> $DIR/rename.rs:32:9
11+
|
12+
LL | #![warn(clippy::new_without_default_derive)]
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
14+
15+
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
16+
--> $DIR/rename.rs:33:9
17+
|
18+
LL | #![warn(clippy::const_static_lifetime)]
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
20+
121
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
2-
--> $DIR/rename.rs:10:9
22+
--> $DIR/rename.rs:34:9
323
|
424
LL | #![warn(clippy::cyclomatic_complexity)]
525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
26+
27+
error: lint `clippy::option_and_then_some` has been renamed to `clippy::bind_instead_of_map`
28+
--> $DIR/rename.rs:35:9
629
|
7-
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
30+
LL | #![warn(clippy::option_and_then_some)]
31+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::bind_instead_of_map`
832

9-
error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
10-
--> $DIR/rename.rs:11:9
33+
error: lint `clippy::box_vec` has been renamed to `clippy::box_collection`
34+
--> $DIR/rename.rs:36:9
1135
|
12-
LL | #![warn(clippy::mem_discriminant_non_enum)]
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
36+
LL | #![warn(clippy::box_vec)]
37+
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::box_collection`
1438

15-
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
16-
--> $DIR/rename.rs:13:8
39+
error: lint `clippy::block_in_if_condition_expr` has been renamed to `clippy::blocks_in_if_conditions`
40+
--> $DIR/rename.rs:37:9
1741
|
18-
LL | #[warn(clippy::stutter)]
19-
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
42+
LL | #![warn(clippy::block_in_if_condition_expr)]
43+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
2044

21-
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
22-
--> $DIR/rename.rs:16:8
45+
error: lint `clippy::block_in_if_condition_stmt` has been renamed to `clippy::blocks_in_if_conditions`
46+
--> $DIR/rename.rs:38:9
2347
|
24-
LL | #[warn(clippy::new_without_default_derive)]
25-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
48+
LL | #![warn(clippy::block_in_if_condition_stmt)]
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_if_conditions`
2650

27-
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
28-
--> $DIR/rename.rs:19:8
51+
error: lint `clippy::option_map_unwrap_or` has been renamed to `clippy::map_unwrap_or`
52+
--> $DIR/rename.rs:39:9
53+
|
54+
LL | #![warn(clippy::option_map_unwrap_or)]
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
56+
57+
error: lint `clippy::option_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
58+
--> $DIR/rename.rs:40:9
59+
|
60+
LL | #![warn(clippy::option_map_unwrap_or_else)]
61+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
62+
63+
error: lint `clippy::result_map_unwrap_or_else` has been renamed to `clippy::map_unwrap_or`
64+
--> $DIR/rename.rs:41:9
65+
|
66+
LL | #![warn(clippy::result_map_unwrap_or_else)]
67+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::map_unwrap_or`
68+
69+
error: lint `clippy::option_unwrap_used` has been renamed to `clippy::unwrap_used`
70+
--> $DIR/rename.rs:42:9
71+
|
72+
LL | #![warn(clippy::option_unwrap_used)]
73+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
74+
75+
error: lint `clippy::result_unwrap_used` has been renamed to `clippy::unwrap_used`
76+
--> $DIR/rename.rs:43:9
77+
|
78+
LL | #![warn(clippy::result_unwrap_used)]
79+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::unwrap_used`
80+
81+
error: lint `clippy::option_expect_used` has been renamed to `clippy::expect_used`
82+
--> $DIR/rename.rs:44:9
83+
|
84+
LL | #![warn(clippy::option_expect_used)]
85+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
86+
87+
error: lint `clippy::result_expect_used` has been renamed to `clippy::expect_used`
88+
--> $DIR/rename.rs:45:9
89+
|
90+
LL | #![warn(clippy::result_expect_used)]
91+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::expect_used`
92+
93+
error: lint `clippy::for_loop_over_option` has been renamed to `clippy::for_loops_over_fallibles`
94+
--> $DIR/rename.rs:46:9
95+
|
96+
LL | #![warn(clippy::for_loop_over_option)]
97+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::for_loops_over_fallibles`
98+
99+
error: lint `clippy::for_loop_over_result` has been renamed to `clippy::for_loops_over_fallibles`
100+
--> $DIR/rename.rs:47:9
101+
|
102+
LL | #![warn(clippy::for_loop_over_result)]
103+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::for_loops_over_fallibles`
104+
105+
error: lint `clippy::identity_conversion` has been renamed to `clippy::useless_conversion`
106+
--> $DIR/rename.rs:48:9
107+
|
108+
LL | #![warn(clippy::identity_conversion)]
109+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::useless_conversion`
110+
111+
error: lint `clippy::zero_width_space` has been renamed to `clippy::invisible_characters`
112+
--> $DIR/rename.rs:49:9
113+
|
114+
LL | #![warn(clippy::zero_width_space)]
115+
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::invisible_characters`
116+
117+
error: lint `clippy::single_char_push_str` has been renamed to `clippy::single_char_add_str`
118+
--> $DIR/rename.rs:50:9
119+
|
120+
LL | #![warn(clippy::single_char_push_str)]
121+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::single_char_add_str`
122+
123+
error: lint `clippy::if_let_some_result` has been renamed to `clippy::match_result_ok`
124+
--> $DIR/rename.rs:51:9
125+
|
126+
LL | #![warn(clippy::if_let_some_result)]
127+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::match_result_ok`
128+
129+
error: lint `clippy::invalid_ref` has been renamed to `invalid_value`
130+
--> $DIR/rename.rs:53:9
131+
|
132+
LL | #![warn(clippy::invalid_ref)]
133+
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_value`
134+
135+
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
136+
--> $DIR/rename.rs:54:9
137+
|
138+
LL | #![warn(clippy::into_iter_on_array)]
139+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `array_into_iter`
140+
141+
error: lint `clippy::unused_label` has been renamed to `unused_labels`
142+
--> $DIR/rename.rs:55:9
143+
|
144+
LL | #![warn(clippy::unused_label)]
145+
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unused_labels`
146+
147+
error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
148+
--> $DIR/rename.rs:56:9
149+
|
150+
LL | #![warn(clippy::drop_bounds)]
151+
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
152+
153+
error: lint `clippy::temporary_cstring_as_ptr` has been renamed to `temporary_cstring_as_ptr`
154+
--> $DIR/rename.rs:57:9
155+
|
156+
LL | #![warn(clippy::temporary_cstring_as_ptr)]
157+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `temporary_cstring_as_ptr`
158+
159+
error: lint `clippy::panic_params` has been renamed to `non_fmt_panics`
160+
--> $DIR/rename.rs:58:9
161+
|
162+
LL | #![warn(clippy::panic_params)]
163+
| ^^^^^^^^^^^^^^^^^^^^ help: use the new name: `non_fmt_panics`
164+
165+
error: lint `clippy::unknown_clippy_lints` has been renamed to `unknown_lints`
166+
--> $DIR/rename.rs:59:9
167+
|
168+
LL | #![warn(clippy::unknown_clippy_lints)]
169+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `unknown_lints`
170+
171+
error: lint `clippy::invalid_atomic_ordering` has been renamed to `invalid_atomic_ordering`
172+
--> $DIR/rename.rs:60:9
173+
|
174+
LL | #![warn(clippy::invalid_atomic_ordering)]
175+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `invalid_atomic_ordering`
176+
177+
error: lint `clippy::mem_discriminant_non_enum` has been renamed to `enum_intrinsics_non_enums`
178+
--> $DIR/rename.rs:61:9
29179
|
30-
LL | #[warn(clippy::const_static_lifetime)]
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
180+
LL | #![warn(clippy::mem_discriminant_non_enum)]
181+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `enum_intrinsics_non_enums`
32182

33-
error: aborting due to 5 previous errors
183+
error: aborting due to 30 previous errors
34184

0 commit comments

Comments
 (0)