Skip to content

Commit fefa7e7

Browse files
krkflip1995
authored andcommitted
Register rename to the LintStore.
1 parent 5574021 commit fefa7e7

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

clippy_lints/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,7 @@ pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
11531153
ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
11541154
ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
11551155
ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
1156+
ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
11561157
}
11571158

11581159
// only exists to let the dogfood integration test works.

tests/ui/rename.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ fn main() {}
77
#[warn(clippy::new_without_default_derive)]
88
struct Foo;
99

10+
#[warn(clippy::const_static_lifetime)]
11+
static Bar: &'static str = "baz";
12+
1013
impl Foo {
1114
fn new() -> Self {
1215
Foo

tests/ui/rename.stderr

+15-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ error: lint `clippy::new_without_default_derive` has been renamed to `clippy::ne
2626
LL | #[warn(clippy::new_without_default_derive)]
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::new_without_default`
2828

29+
error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redundant_static_lifetimes`
30+
--> $DIR/rename.rs:10:8
31+
|
32+
LL | #[warn(clippy::const_static_lifetime)]
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
34+
2935
error: unknown lint: `stutter`
3036
--> $DIR/rename.rs:1:10
3137
|
@@ -38,5 +44,13 @@ error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cogniti
3844
LL | #![warn(clippy::cyclomatic_complexity)]
3945
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
4046

41-
error: aborting due to 6 previous errors
47+
error: Statics have by default a `'static` lifetime
48+
--> $DIR/rename.rs:11:14
49+
|
50+
LL | static Bar: &'static str = "baz";
51+
| -^^^^^^^---- help: consider removing `'static`: `&str`
52+
|
53+
= note: `-D clippy::redundant-static-lifetimes` implied by `-D warnings`
54+
55+
error: aborting due to 8 previous errors
4256

0 commit comments

Comments
 (0)