about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCameron Steffen <cam.steffen94@gmail.com>2021-05-07 14:53:02 -0500
committerCameron Steffen <cam.steffen94@gmail.com>2021-05-07 17:26:32 -0500
commit2e2bba94be6d51c986536c80899e57fc3732ecd8 (patch)
tree3ca506b9a17d8b0b4ffd7a699d409d81fb64fc37
parent24acc388da2cdbe1ec79b6933402941b6fffb26b (diff)
downloadrust-2e2bba94be6d51c986536c80899e57fc3732ecd8.tar.gz
rust-2e2bba94be6d51c986536c80899e57fc3732ecd8.zip
Fix duplicate unknown lint errors
-rw-r--r--compiler/rustc_lint/src/early.rs6
-rw-r--r--src/tools/clippy/tests/ui/deprecated.stderr8
-rw-r--r--src/tools/clippy/tests/ui/deprecated_old.stderr8
-rw-r--r--src/tools/clippy/tests/ui/rename.stderr8
-rw-r--r--src/tools/clippy/tests/ui/unknown_clippy_lints.stderr8
5 files changed, 7 insertions, 31 deletions
diff --git a/compiler/rustc_lint/src/early.rs b/compiler/rustc_lint/src/early.rs
index 54fcaef414f..eb2e495f73d 100644
--- a/compiler/rustc_lint/src/early.rs
+++ b/compiler/rustc_lint/src/early.rs
@@ -367,11 +367,11 @@ pub fn check_ast_crate<T: EarlyLintPass>(
                 krate,
                 EarlyLintPassObjects { lints: &mut passes[..] },
                 buffered,
-                pre_expansion,
+                false,
             );
         }
     } else {
-        for pass in &mut passes {
+        for (i, pass) in passes.iter_mut().enumerate() {
             buffered =
                 sess.prof.extra_verbose_generic_activity("run_lint", pass.name()).run(|| {
                     early_lint_crate(
@@ -380,7 +380,7 @@ pub fn check_ast_crate<T: EarlyLintPass>(
                         krate,
                         EarlyLintPassObjects { lints: slice::from_mut(pass) },
                         buffered,
-                        pre_expansion,
+                        pre_expansion && i == 0,
                     )
                 });
         }
diff --git a/src/tools/clippy/tests/ui/deprecated.stderr b/src/tools/clippy/tests/ui/deprecated.stderr
index 3e125c1dab5..e5de839dbc5 100644
--- a/src/tools/clippy/tests/ui/deprecated.stderr
+++ b/src/tools/clippy/tests/ui/deprecated.stderr
@@ -84,11 +84,5 @@ error: lint `clippy::filter_map` has been removed: this lint has been replaced b
 LL | #[warn(clippy::filter_map)]
    |        ^^^^^^^^^^^^^^^^^^
 
-error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
-  --> $DIR/deprecated.rs:1:8
-   |
-LL | #[warn(clippy::unstable_as_slice)]
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 15 previous errors
+error: aborting due to 14 previous errors
 
diff --git a/src/tools/clippy/tests/ui/deprecated_old.stderr b/src/tools/clippy/tests/ui/deprecated_old.stderr
index b8550078c46..8043ab0058a 100644
--- a/src/tools/clippy/tests/ui/deprecated_old.stderr
+++ b/src/tools/clippy/tests/ui/deprecated_old.stderr
@@ -18,11 +18,5 @@ error: lint `misaligned_transmute` has been removed: this lint has been split in
 LL | #[warn(misaligned_transmute)]
    |        ^^^^^^^^^^^^^^^^^^^^
 
-error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
-  --> $DIR/deprecated_old.rs:1:8
-   |
-LL | #[warn(unstable_as_slice)]
-   |        ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/src/tools/clippy/tests/ui/rename.stderr b/src/tools/clippy/tests/ui/rename.stderr
index a9e80394604..c5d633ff86b 100644
--- a/src/tools/clippy/tests/ui/rename.stderr
+++ b/src/tools/clippy/tests/ui/rename.stderr
@@ -24,11 +24,5 @@ error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redunda
 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:10:9
-   |
-LL | #![warn(clippy::cyclomatic_complexity)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
-
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
diff --git a/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr b/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr
index 94a667e5898..421bf5ffa9a 100644
--- a/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr
+++ b/src/tools/clippy/tests/ui/unknown_clippy_lints.stderr
@@ -48,11 +48,5 @@ error: unknown lint: `clippy::const_static_lifetim`
 LL | #[warn(clippy::const_static_lifetim)]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::redundant_static_lifetimes`
 
-error: unknown lint: `clippy::All`
-  --> $DIR/unknown_clippy_lints.rs:5:10
-   |
-LL | #![allow(clippy::All)]
-   |          ^^^^^^^^^^^ help: did you mean: `clippy::all`
-
-error: aborting due to 9 previous errors
+error: aborting due to 8 previous errors