about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--clippy_lints/src/lib.rs1
-rw-r--r--tests/ui/rename.rs3
-rw-r--r--tests/ui/rename.stderr16
3 files changed, 19 insertions, 1 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 5ffa7172210..cfd6070356d 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -1153,6 +1153,7 @@ pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
     ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
     ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
     ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
+    ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
 }
 
 // only exists to let the dogfood integration test works.
diff --git a/tests/ui/rename.rs b/tests/ui/rename.rs
index b1846a1096c..1e25d1812c6 100644
--- a/tests/ui/rename.rs
+++ b/tests/ui/rename.rs
@@ -7,6 +7,9 @@ fn main() {}
 #[warn(clippy::new_without_default_derive)]
 struct Foo;
 
+#[warn(clippy::const_static_lifetime)]
+static Bar: &'static str = "baz";
+
 impl Foo {
     fn new() -> Self {
         Foo
diff --git a/tests/ui/rename.stderr b/tests/ui/rename.stderr
index ac850b60d97..6fcf0e29924 100644
--- a/tests/ui/rename.stderr
+++ b/tests/ui/rename.stderr
@@ -26,6 +26,12 @@ error: lint `clippy::new_without_default_derive` has been renamed to `clippy::ne
 LL | #[warn(clippy::new_without_default_derive)]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
 
+error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
+  --> $DIR/rename.rs:10:8
+   |
+LL | #[warn(clippy::const_static_lifetime)]
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
+
 error: unknown lint: `stutter`
   --> $DIR/rename.rs:1:10
    |
@@ -38,5 +44,13 @@ error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cogniti
 LL | #![warn(clippy::cyclomatic_complexity)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
 
-error: aborting due to 6 previous errors
+error: Statics have by default a `'static` lifetime
+  --> $DIR/rename.rs:11:14
+   |
+LL | static Bar: &'static str = "baz";
+   |             -^^^^^^^---- help: consider removing `'static`: `&str`
+   |
+   = note: `-D clippy::redundant-static-lifetimes` implied by `-D warnings`
+
+error: aborting due to 8 previous errors