Skip to content

Commit

Permalink
Register rename to the LintStore.
Browse files Browse the repository at this point in the history
  • Loading branch information
krk authored and flip1995 committed Jun 14, 2019
1 parent 5574021 commit fefa7e7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions clippy_lints/src/lib.rs
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/rename.rs
Expand Up @@ -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
Expand Down
16 changes: 15 additions & 1 deletion tests/ui/rename.stderr
Expand Up @@ -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
|
Expand All @@ -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

0 comments on commit fefa7e7

Please sign in to comment.