mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Add run-rustfix for rename test
I removed the `Bar` static and `Foo` impl because they are not needed for what's tested here as far as I can tell.
This commit is contained in:
parent
dea92fada5
commit
8a161d71f8
3 changed files with 28 additions and 12 deletions
20
tests/ui/rename.fixed
Normal file
20
tests/ui/rename.fixed
Normal file
|
@ -0,0 +1,20 @@
|
|||
//! Test for Clippy lint renames.
|
||||
// run-rustfix
|
||||
|
||||
#![allow(dead_code)]
|
||||
// allow the new lint name here, to test if the new name works
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
#![allow(clippy::new_without_default)]
|
||||
#![allow(clippy::cognitive_complexity)]
|
||||
#![allow(clippy::redundant_static_lifetimes)]
|
||||
// warn for the old lint name here, to test if the renaming worked
|
||||
#![warn(clippy::cognitive_complexity)]
|
||||
|
||||
#[warn(clippy::module_name_repetitions)]
|
||||
fn main() {}
|
||||
|
||||
#[warn(clippy::new_without_default)]
|
||||
struct Foo;
|
||||
|
||||
#[warn(clippy::redundant_static_lifetimes)]
|
||||
fn foo() {}
|
|
@ -1,5 +1,7 @@
|
|||
//! Test for Clippy lint renames.
|
||||
// run-rustfix
|
||||
|
||||
#![allow(dead_code)]
|
||||
// allow the new lint name here, to test if the new name works
|
||||
#![allow(clippy::module_name_repetitions)]
|
||||
#![allow(clippy::new_without_default)]
|
||||
|
@ -15,10 +17,4 @@ fn main() {}
|
|||
struct Foo;
|
||||
|
||||
#[warn(clippy::const_static_lifetime)]
|
||||
static Bar: &'static str = "baz";
|
||||
|
||||
impl Foo {
|
||||
fn new() -> Self {
|
||||
Foo
|
||||
}
|
||||
}
|
||||
fn foo() {}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
|
||||
--> $DIR/rename.rs:9:9
|
||||
--> $DIR/rename.rs:11:9
|
||||
|
|
||||
LL | #![warn(clippy::cyclomatic_complexity)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
|
||||
|
@ -7,25 +7,25 @@ LL | #![warn(clippy::cyclomatic_complexity)]
|
|||
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
|
||||
|
||||
error: lint `clippy::stutter` has been renamed to `clippy::module_name_repetitions`
|
||||
--> $DIR/rename.rs:11:8
|
||||
--> $DIR/rename.rs:13:8
|
||||
|
|
||||
LL | #[warn(clippy::stutter)]
|
||||
| ^^^^^^^^^^^^^^^ help: use the new name: `clippy::module_name_repetitions`
|
||||
|
||||
error: lint `clippy::new_without_default_derive` has been renamed to `clippy::new_without_default`
|
||||
--> $DIR/rename.rs:14:8
|
||||
--> $DIR/rename.rs:16:8
|
||||
|
|
||||
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:17:8
|
||||
--> $DIR/rename.rs:19:8
|
||||
|
|
||||
LL | #[warn(clippy::const_static_lifetime)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
|
||||
|
||||
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
|
||||
--> $DIR/rename.rs:9:9
|
||||
--> $DIR/rename.rs:11:9
|
||||
|
|
||||
LL | #![warn(clippy::cyclomatic_complexity)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
|
||||
|
|
Loading…
Reference in a new issue