Skip to content

Commit 2c4b437

Browse files
committed
Keep old deprecated lints deprecated as non-tool, too
1 parent 67bb612 commit 2c4b437

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

clippy_lints/src/lib.rs

+49
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(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,53 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
11641166
]);
11651167
}
11661168

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