Skip to content

Commit 0b7e237

Browse files
committed
Keep old deprecated lints deprecated as non-tool, too
1 parent 5114050 commit 0b7e237

File tree

2 files changed

+56
-6
lines changed

2 files changed

+56
-6
lines changed

clippy_lints/src/lib.rs

+50
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ pub fn read_conf(reg: &rustc_plugin::Registry<'_>) -> Conf {
384384
#[rustfmt::skip]
385385
pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
386386
let mut store = reg.sess.lint_store.borrow_mut();
387+
register_removed_non_tool_lints(&mut store);
388+
387389
// begin deprecated lints, do not remove this comment, it’s used in `update_lints`
388390
store.register_removed(
389391
"clippy::should_assert_eq",
@@ -1164,6 +1166,54 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
11641166
]);
11651167
}
11661168

1169+
#[rustfmt::skip]
1170+
fn register_removed_non_tool_lints(store: &mut rustc::lint::LintStore) {
1171+
store.register_removed(
1172+
"should_assert_eq",
1173+
"`assert!()` will be more flexible with RFC 2011",
1174+
);
1175+
store.register_removed(
1176+
"extend_from_slice",
1177+
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
1178+
);
1179+
store.register_removed(
1180+
"range_step_by_zero",
1181+
"`iterator.step_by(0)` panics nowadays",
1182+
);
1183+
store.register_removed(
1184+
"unstable_as_slice",
1185+
"`Vec::as_slice` has been stabilized in 1.7",
1186+
);
1187+
store.register_removed(
1188+
"unstable_as_mut_slice",
1189+
"`Vec::as_mut_slice` has been stabilized in 1.7",
1190+
);
1191+
store.register_removed(
1192+
"str_to_string",
1193+
"using `str::to_string` is common even today and specialization will likely happen soon",
1194+
);
1195+
store.register_removed(
1196+
"string_to_string",
1197+
"using `string::to_string` is common even today and specialization will likely happen soon",
1198+
);
1199+
store.register_removed(
1200+
"misaligned_transmute",
1201+
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
1202+
);
1203+
store.register_removed(
1204+
"assign_ops",
1205+
"using compound assignment operators (e.g., `+=`) is harmless",
1206+
);
1207+
store.register_removed(
1208+
"if_let_redundant_pattern_matching",
1209+
"this lint has been changed to redundant_pattern_matching",
1210+
);
1211+
store.register_removed(
1212+
"unsafe_vector_initialization",
1213+
"the replacement suggested by this lint had substantially different behavior",
1214+
);
1215+
}
1216+
11671217
/// Register renamed lints.
11681218
///
11691219
/// Used in `./src/driver.rs`.

tests/ui/deprecated.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#[warn(clippy::str_to_string)]
2-
#[warn(clippy::string_to_string)]
3-
#[warn(clippy::unstable_as_slice)]
4-
#[warn(clippy::unstable_as_mut_slice)]
5-
#[warn(clippy::misaligned_transmute)]
6-
#[warn(clippy::unused_collect)]
1+
#[warn(str_to_string)]
2+
#[warn(string_to_string)]
3+
#[warn(unstable_as_slice)]
4+
#[warn(unstable_as_mut_slice)]
5+
#[warn(misaligned_transmute)]
6+
#[warn(unused_collect)]
77

88
fn main() {}

0 commit comments

Comments
 (0)