]> git.lizzy.rs Git - rust.git/commitdiff
Keep old deprecated lints deprecated as non-tool, too
authorPhilipp Hansch <dev@phansch.net>
Mon, 12 Aug 2019 05:28:07 +0000 (07:28 +0200)
committerPhilipp Hansch <dev@phansch.net>
Mon, 12 Aug 2019 17:42:23 +0000 (19:42 +0200)
clippy_lints/src/lib.rs
tests/ui/deprecated.rs

index 784a10882aa5a4fba29360e4f8aaf252d6854ead..0ac0a5304bd19975edade3d8189c4e89de2a9205 100644 (file)
@@ -384,6 +384,8 @@ pub fn read_conf(reg: &rustc_plugin::Registry<'_>) -> Conf {
 #[rustfmt::skip]
 pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
     let mut store = reg.sess.lint_store.borrow_mut();
+    register_removed_non_tool_lints(&mut store);
+
     // begin deprecated lints, do not remove this comment, it’s used in `update_lints`
     store.register_removed(
         "clippy::should_assert_eq",
@@ -1164,6 +1166,54 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
     ]);
 }
 
+#[rustfmt::skip]
+fn register_removed_non_tool_lints(store: &mut rustc::lint::LintStore) {
+    store.register_removed(
+        "should_assert_eq",
+        "`assert!()` will be more flexible with RFC 2011",
+    );
+    store.register_removed(
+        "extend_from_slice",
+        "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
+    );
+    store.register_removed(
+        "range_step_by_zero",
+        "`iterator.step_by(0)` panics nowadays",
+    );
+    store.register_removed(
+        "unstable_as_slice",
+        "`Vec::as_slice` has been stabilized in 1.7",
+    );
+    store.register_removed(
+        "unstable_as_mut_slice",
+        "`Vec::as_mut_slice` has been stabilized in 1.7",
+    );
+    store.register_removed(
+        "str_to_string",
+        "using `str::to_string` is common even today and specialization will likely happen soon",
+    );
+    store.register_removed(
+        "string_to_string",
+        "using `string::to_string` is common even today and specialization will likely happen soon",
+    );
+    store.register_removed(
+        "misaligned_transmute",
+        "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
+    );
+    store.register_removed(
+        "assign_ops",
+        "using compound assignment operators (e.g., `+=`) is harmless",
+    );
+    store.register_removed(
+        "if_let_redundant_pattern_matching",
+        "this lint has been changed to redundant_pattern_matching",
+    );
+    store.register_removed(
+        "unsafe_vector_initialization",
+        "the replacement suggested by this lint had substantially different behavior",
+    );
+}
+
 /// Register renamed lints.
 ///
 /// Used in `./src/driver.rs`.
index 7ad330cb305ac5c4cbfe7803e6f564f9945895bb..cd6a3a5bf5a9625b15a1cd9bb84cb3f7301b3e89 100644 (file)
@@ -1,8 +1,8 @@
-#[warn(clippy::str_to_string)]
-#[warn(clippy::string_to_string)]
-#[warn(clippy::unstable_as_slice)]
-#[warn(clippy::unstable_as_mut_slice)]
-#[warn(clippy::misaligned_transmute)]
-#[warn(clippy::unused_collect)]
+#[warn(str_to_string)]
+#[warn(string_to_string)]
+#[warn(unstable_as_slice)]
+#[warn(unstable_as_mut_slice)]
+#[warn(misaligned_transmute)]
+#[warn(unused_collect)]
 
 fn main() {}