about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2019-08-18 09:37:12 +0200
committerPhilipp Hansch <dev@phansch.net>2019-08-28 07:23:23 +0200
commit8a161d71f8fb99d93afd83a6bcb0ccf9653fc73b (patch)
treea0c8cd0da5cc3332f399df95c93b2e02e6aff427
parentdea92fada5c06a1bbb41ff8dd87de74781c7e9e8 (diff)
downloadrust-8a161d71f8fb99d93afd83a6bcb0ccf9653fc73b.tar.gz
rust-8a161d71f8fb99d93afd83a6bcb0ccf9653fc73b.zip
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.
-rw-r--r--tests/ui/rename.fixed20
-rw-r--r--tests/ui/rename.rs10
-rw-r--r--tests/ui/rename.stderr10
3 files changed, 28 insertions, 12 deletions
diff --git a/tests/ui/rename.fixed b/tests/ui/rename.fixed
new file mode 100644
index 00000000000..947914aa123
--- /dev/null
+++ b/tests/ui/rename.fixed
@@ -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() {}
diff --git a/tests/ui/rename.rs b/tests/ui/rename.rs
index f3758174125..e2c8c223fc7 100644
--- a/tests/ui/rename.rs
+++ b/tests/ui/rename.rs
@@ -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() {}
diff --git a/tests/ui/rename.stderr b/tests/ui/rename.stderr
index 0765e6e954a..83c7f26ba5f 100644
--- a/tests/ui/rename.stderr
+++ b/tests/ui/rename.stderr
@@ -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`