Skip to content

Commit 1672d5d

Browse files
committed
Mark some lint deprecations as renames
1 parent e611c8e commit 1672d5d

File tree

8 files changed

+121
-186
lines changed

8 files changed

+121
-186
lines changed

clippy_lints/src/deprecated_lints.rs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,6 @@ declare_deprecated_lint! {
108108
"using compound assignment operators (e.g., `+=`) is harmless"
109109
}
110110

111-
declare_deprecated_lint! {
112-
/// ### What it does
113-
/// Nothing. This lint has been deprecated.
114-
///
115-
/// ### Deprecation reason
116-
/// The original rule will only lint for `if let`. After
117-
/// making it support to lint `match`, naming as `if let` is not suitable for it.
118-
/// So, this lint is deprecated.
119-
#[clippy::version = "pre 1.29.0"]
120-
pub IF_LET_REDUNDANT_PATTERN_MATCHING,
121-
"this lint has been changed to redundant_pattern_matching"
122-
}
123-
124111
declare_deprecated_lint! {
125112
/// ### What it does
126113
/// Nothing. This lint has been deprecated.
@@ -168,30 +155,6 @@ declare_deprecated_lint! {
168155
"the regex! macro has been removed from the regex crate in 2018"
169156
}
170157

171-
declare_deprecated_lint! {
172-
/// ### What it does
173-
/// Nothing. This lint has been deprecated.
174-
///
175-
/// ### Deprecation reason
176-
/// This lint has been replaced by `manual_find_map`, a
177-
/// more specific lint.
178-
#[clippy::version = "1.51.0"]
179-
pub FIND_MAP,
180-
"this lint has been replaced by `manual_find_map`, a more specific lint"
181-
}
182-
183-
declare_deprecated_lint! {
184-
/// ### What it does
185-
/// Nothing. This lint has been deprecated.
186-
///
187-
/// ### Deprecation reason
188-
/// This lint has been replaced by `manual_filter_map`, a
189-
/// more specific lint.
190-
#[clippy::version = "1.53.0"]
191-
pub FILTER_MAP,
192-
"this lint has been replaced by `manual_filter_map`, a more specific lint"
193-
}
194-
195158
declare_deprecated_lint! {
196159
/// ### What it does
197160
/// Nothing. This lint has been deprecated.
@@ -215,29 +178,3 @@ declare_deprecated_lint! {
215178
pub WRONG_PUB_SELF_CONVENTION,
216179
"set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items"
217180
}
218-
219-
declare_deprecated_lint! {
220-
/// ### What it does
221-
/// Nothing. This lint has been deprecated.
222-
///
223-
/// ### Deprecation reason
224-
/// This lint has been superseded by rustc's own [`unexpected_cfgs`] lint that is able to detect the `#[cfg(features)]` and `#[cfg(tests)]` typos.
225-
///
226-
/// [`unexpected_cfgs`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#unexpected-cfgs
227-
#[clippy::version = "1.80.0"]
228-
pub MAYBE_MISUSED_CFG,
229-
"this lint has been replaced by `unexpected_cfgs`"
230-
}
231-
232-
declare_deprecated_lint! {
233-
/// ### What it does
234-
/// Nothing. This lint has been deprecated.
235-
///
236-
/// ### Deprecation reason
237-
/// This lint has been superseded by rustc's own [`unexpected_cfgs`] lint that is able to detect invalid `#[cfg(linux)]` attributes.
238-
///
239-
/// [`unexpected_cfgs`]: https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#unexpected-cfgs
240-
#[clippy::version = "1.80.0"]
241-
pub MISMATCHED_TARGET_OS,
242-
"this lint has been replaced by `unexpected_cfgs`"
243-
}

clippy_lints/src/lib.deprecated.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
"clippy::assign_ops",
3232
"using compound assignment operators (e.g., `+=`) is harmless",
3333
);
34-
store.register_removed(
35-
"clippy::if_let_redundant_pattern_matching",
36-
"this lint has been changed to redundant_pattern_matching",
37-
);
3834
store.register_removed(
3935
"clippy::unsafe_vector_initialization",
4036
"the replacement suggested by this lint had substantially different behavior",
@@ -51,14 +47,6 @@
5147
"clippy::regex_macro",
5248
"the regex! macro has been removed from the regex crate in 2018",
5349
);
54-
store.register_removed(
55-
"clippy::find_map",
56-
"this lint has been replaced by `manual_find_map`, a more specific lint",
57-
);
58-
store.register_removed(
59-
"clippy::filter_map",
60-
"this lint has been replaced by `manual_filter_map`, a more specific lint",
61-
);
6250
store.register_removed(
6351
"clippy::pub_enum_variant_names",
6452
"set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items",
@@ -67,12 +55,4 @@
6755
"clippy::wrong_pub_self_convention",
6856
"set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items",
6957
);
70-
store.register_removed(
71-
"clippy::maybe_misused_cfg",
72-
"this lint has been replaced by `unexpected_cfgs`",
73-
);
74-
store.register_removed(
75-
"clippy::mismatched_target_os",
76-
"this lint has been replaced by `unexpected_cfgs`",
77-
);
7858
}

clippy_lints/src/renamed_lints.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
1414
("clippy::disallowed_method", "clippy::disallowed_methods"),
1515
("clippy::disallowed_type", "clippy::disallowed_types"),
1616
("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"),
17+
("clippy::find_map", "clippy::manual_find_map"),
18+
("clippy::filter_map", "clippy::manual_filter_map"),
1719
("clippy::identity_conversion", "clippy::useless_conversion"),
20+
("clippy::if_let_redundant_pattern_matching", "clippy::redundant_pattern_matching"),
1821
("clippy::if_let_some_result", "clippy::match_result_ok"),
1922
("clippy::incorrect_clone_impl_on_copy_type", "clippy::non_canonical_clone_impl"),
2023
("clippy::incorrect_partial_ord_impl_on_ord_type", "clippy::non_canonical_partial_ord_impl"),
@@ -54,7 +57,9 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
5457
("clippy::invalid_ref", "invalid_value"),
5558
("clippy::invalid_utf8_in_unchecked", "invalid_from_utf8_unchecked"),
5659
("clippy::let_underscore_drop", "let_underscore_drop"),
60+
("clippy::maybe_misused_cfg", "unexpected_cfgs"),
5761
("clippy::mem_discriminant_non_enum", "enum_intrinsics_non_enums"),
62+
("clippy::mismatched_target_os", "unexpected_cfgs"),
5863
("clippy::panic_params", "non_fmt_panics"),
5964
("clippy::positional_named_format_parameters", "named_arguments_used_positionally"),
6065
("clippy::temporary_cstring_as_ptr", "temporary_cstring_as_ptr"),

tests/ui/deprecated.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99
#![warn(clippy::unstable_as_mut_slice)]
1010
#![warn(clippy::misaligned_transmute)]
1111
#![warn(clippy::assign_ops)]
12-
#![warn(clippy::if_let_redundant_pattern_matching)]
1312
#![warn(clippy::unsafe_vector_initialization)]
1413
#![warn(clippy::unused_collect)]
1514
#![warn(clippy::replace_consts)]
1615
#![warn(clippy::regex_macro)]
17-
#![warn(clippy::find_map)]
18-
#![warn(clippy::filter_map)]
1916
#![warn(clippy::pub_enum_variant_names)]
2017
#![warn(clippy::wrong_pub_self_convention)]
21-
#![warn(clippy::maybe_misused_cfg)]
22-
#![warn(clippy::mismatched_target_os)]
2318

2419
fn main() {}

tests/ui/deprecated.stderr

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -43,71 +43,41 @@ error: lint `clippy::assign_ops` has been removed: using compound assignment ope
4343
LL | #![warn(clippy::assign_ops)]
4444
| ^^^^^^^^^^^^^^^^^^
4545

46-
error: lint `clippy::if_let_redundant_pattern_matching` has been removed: this lint has been changed to redundant_pattern_matching
47-
--> tests/ui/deprecated.rs:12:9
48-
|
49-
LL | #![warn(clippy::if_let_redundant_pattern_matching)]
50-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51-
5246
error: lint `clippy::unsafe_vector_initialization` has been removed: the replacement suggested by this lint had substantially different behavior
53-
--> tests/ui/deprecated.rs:13:9
47+
--> tests/ui/deprecated.rs:12:9
5448
|
5549
LL | #![warn(clippy::unsafe_vector_initialization)]
5650
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5751

5852
error: lint `clippy::unused_collect` has been removed: `collect` has been marked as #[must_use] in rustc and that covers all cases of this lint
59-
--> tests/ui/deprecated.rs:14:9
53+
--> tests/ui/deprecated.rs:13:9
6054
|
6155
LL | #![warn(clippy::unused_collect)]
6256
| ^^^^^^^^^^^^^^^^^^^^^^
6357

6458
error: lint `clippy::replace_consts` has been removed: associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants
65-
--> tests/ui/deprecated.rs:15:9
59+
--> tests/ui/deprecated.rs:14:9
6660
|
6761
LL | #![warn(clippy::replace_consts)]
6862
| ^^^^^^^^^^^^^^^^^^^^^^
6963

7064
error: lint `clippy::regex_macro` has been removed: the regex! macro has been removed from the regex crate in 2018
71-
--> tests/ui/deprecated.rs:16:9
65+
--> tests/ui/deprecated.rs:15:9
7266
|
7367
LL | #![warn(clippy::regex_macro)]
7468
| ^^^^^^^^^^^^^^^^^^^
7569

76-
error: lint `clippy::find_map` has been removed: this lint has been replaced by `manual_find_map`, a more specific lint
77-
--> tests/ui/deprecated.rs:17:9
78-
|
79-
LL | #![warn(clippy::find_map)]
80-
| ^^^^^^^^^^^^^^^^
81-
82-
error: lint `clippy::filter_map` has been removed: this lint has been replaced by `manual_filter_map`, a more specific lint
83-
--> tests/ui/deprecated.rs:18:9
84-
|
85-
LL | #![warn(clippy::filter_map)]
86-
| ^^^^^^^^^^^^^^^^^^
87-
8870
error: lint `clippy::pub_enum_variant_names` has been removed: set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items
89-
--> tests/ui/deprecated.rs:19:9
71+
--> tests/ui/deprecated.rs:16:9
9072
|
9173
LL | #![warn(clippy::pub_enum_variant_names)]
9274
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9375

9476
error: lint `clippy::wrong_pub_self_convention` has been removed: set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items
95-
--> tests/ui/deprecated.rs:20:9
77+
--> tests/ui/deprecated.rs:17:9
9678
|
9779
LL | #![warn(clippy::wrong_pub_self_convention)]
9880
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9981

100-
error: lint `clippy::maybe_misused_cfg` has been removed: this lint has been replaced by `unexpected_cfgs`
101-
--> tests/ui/deprecated.rs:21:9
102-
|
103-
LL | #![warn(clippy::maybe_misused_cfg)]
104-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
105-
106-
error: lint `clippy::mismatched_target_os` has been removed: this lint has been replaced by `unexpected_cfgs`
107-
--> tests/ui/deprecated.rs:22:9
108-
|
109-
LL | #![warn(clippy::mismatched_target_os)]
110-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111-
112-
error: aborting due to 18 previous errors
82+
error: aborting due to 13 previous errors
11383

tests/ui/rename.fixed

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
#![allow(clippy::disallowed_methods)]
1414
#![allow(clippy::disallowed_types)]
1515
#![allow(clippy::mixed_read_write_in_expression)]
16+
#![allow(clippy::manual_find_map)]
17+
#![allow(clippy::manual_filter_map)]
1618
#![allow(clippy::useless_conversion)]
19+
#![allow(clippy::redundant_pattern_matching)]
1720
#![allow(clippy::match_result_ok)]
1821
#![allow(clippy::non_canonical_clone_impl)]
1922
#![allow(clippy::non_canonical_partial_ord_impl)]
@@ -47,6 +50,7 @@
4750
#![allow(invalid_value)]
4851
#![allow(invalid_from_utf8_unchecked)]
4952
#![allow(let_underscore_drop)]
53+
#![allow(unexpected_cfgs)]
5054
#![allow(enum_intrinsics_non_enums)]
5155
#![allow(non_fmt_panics)]
5256
#![allow(named_arguments_used_positionally)]
@@ -67,7 +71,10 @@
6771
#![warn(clippy::disallowed_methods)]
6872
#![warn(clippy::disallowed_types)]
6973
#![warn(clippy::mixed_read_write_in_expression)]
74+
#![warn(clippy::manual_find_map)]
75+
#![warn(clippy::manual_filter_map)]
7076
#![warn(clippy::useless_conversion)]
77+
#![warn(clippy::redundant_pattern_matching)]
7178
#![warn(clippy::match_result_ok)]
7279
#![warn(clippy::non_canonical_clone_impl)]
7380
#![warn(clippy::non_canonical_partial_ord_impl)]
@@ -107,7 +114,9 @@
107114
#![warn(invalid_value)]
108115
#![warn(invalid_from_utf8_unchecked)]
109116
#![warn(let_underscore_drop)]
117+
#![warn(unexpected_cfgs)]
110118
#![warn(enum_intrinsics_non_enums)]
119+
#![warn(unexpected_cfgs)]
111120
#![warn(non_fmt_panics)]
112121
#![warn(named_arguments_used_positionally)]
113122
#![warn(temporary_cstring_as_ptr)]

tests/ui/rename.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
#![allow(clippy::disallowed_methods)]
1414
#![allow(clippy::disallowed_types)]
1515
#![allow(clippy::mixed_read_write_in_expression)]
16+
#![allow(clippy::manual_find_map)]
17+
#![allow(clippy::manual_filter_map)]
1618
#![allow(clippy::useless_conversion)]
19+
#![allow(clippy::redundant_pattern_matching)]
1720
#![allow(clippy::match_result_ok)]
1821
#![allow(clippy::non_canonical_clone_impl)]
1922
#![allow(clippy::non_canonical_partial_ord_impl)]
@@ -47,6 +50,7 @@
4750
#![allow(invalid_value)]
4851
#![allow(invalid_from_utf8_unchecked)]
4952
#![allow(let_underscore_drop)]
53+
#![allow(unexpected_cfgs)]
5054
#![allow(enum_intrinsics_non_enums)]
5155
#![allow(non_fmt_panics)]
5256
#![allow(named_arguments_used_positionally)]
@@ -67,7 +71,10 @@
6771
#![warn(clippy::disallowed_method)]
6872
#![warn(clippy::disallowed_type)]
6973
#![warn(clippy::eval_order_dependence)]
74+
#![warn(clippy::find_map)]
75+
#![warn(clippy::filter_map)]
7076
#![warn(clippy::identity_conversion)]
77+
#![warn(clippy::if_let_redundant_pattern_matching)]
7178
#![warn(clippy::if_let_some_result)]
7279
#![warn(clippy::incorrect_clone_impl_on_copy_type)]
7380
#![warn(clippy::incorrect_partial_ord_impl_on_ord_type)]
@@ -107,7 +114,9 @@
107114
#![warn(clippy::invalid_ref)]
108115
#![warn(clippy::invalid_utf8_in_unchecked)]
109116
#![warn(clippy::let_underscore_drop)]
117+
#![warn(clippy::maybe_misused_cfg)]
110118
#![warn(clippy::mem_discriminant_non_enum)]
119+
#![warn(clippy::mismatched_target_os)]
111120
#![warn(clippy::panic_params)]
112121
#![warn(clippy::positional_named_format_parameters)]
113122
#![warn(clippy::temporary_cstring_as_ptr)]

0 commit comments

Comments
 (0)