Skip to content

Commit 1b30245

Browse files
committed
Auto merge of #85053 - camsteffen:duplicate-lint, r=davidtwco
Fix duplicate unknown lint errors Fixes rust-lang/rust-clippy#6602
2 parents 2fb1dee + 2e2bba9 commit 1b30245

File tree

5 files changed

+7
-31
lines changed

5 files changed

+7
-31
lines changed

compiler/rustc_lint/src/early.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,11 @@ pub fn check_ast_crate<T: EarlyLintPass>(
367367
krate,
368368
EarlyLintPassObjects { lints: &mut passes[..] },
369369
buffered,
370-
pre_expansion,
370+
false,
371371
);
372372
}
373373
} else {
374-
for pass in &mut passes {
374+
for (i, pass) in passes.iter_mut().enumerate() {
375375
buffered =
376376
sess.prof.extra_verbose_generic_activity("run_lint", pass.name()).run(|| {
377377
early_lint_crate(
@@ -380,7 +380,7 @@ pub fn check_ast_crate<T: EarlyLintPass>(
380380
krate,
381381
EarlyLintPassObjects { lints: slice::from_mut(pass) },
382382
buffered,
383-
pre_expansion,
383+
pre_expansion && i == 0,
384384
)
385385
});
386386
}

src/tools/clippy/tests/ui/deprecated.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,5 @@ error: lint `clippy::filter_map` has been removed: this lint has been replaced b
8484
LL | #[warn(clippy::filter_map)]
8585
| ^^^^^^^^^^^^^^^^^^
8686

87-
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
88-
--> $DIR/deprecated.rs:1:8
89-
|
90-
LL | #[warn(clippy::unstable_as_slice)]
91-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
92-
93-
error: aborting due to 15 previous errors
87+
error: aborting due to 14 previous errors
9488

src/tools/clippy/tests/ui/deprecated_old.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,5 @@ error: lint `misaligned_transmute` has been removed: this lint has been split in
1818
LL | #[warn(misaligned_transmute)]
1919
| ^^^^^^^^^^^^^^^^^^^^
2020

21-
error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
22-
--> $DIR/deprecated_old.rs:1:8
23-
|
24-
LL | #[warn(unstable_as_slice)]
25-
| ^^^^^^^^^^^^^^^^^
26-
27-
error: aborting due to 4 previous errors
21+
error: aborting due to 3 previous errors
2822

src/tools/clippy/tests/ui/rename.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,5 @@ error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redunda
2424
LL | #[warn(clippy::const_static_lifetime)]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
2626

27-
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
28-
--> $DIR/rename.rs:10:9
29-
|
30-
LL | #![warn(clippy::cyclomatic_complexity)]
31-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
32-
33-
error: aborting due to 5 previous errors
27+
error: aborting due to 4 previous errors
3428

src/tools/clippy/tests/ui/unknown_clippy_lints.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,5 @@ error: unknown lint: `clippy::const_static_lifetim`
4848
LL | #[warn(clippy::const_static_lifetim)]
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::redundant_static_lifetimes`
5050

51-
error: unknown lint: `clippy::All`
52-
--> $DIR/unknown_clippy_lints.rs:5:10
53-
|
54-
LL | #![allow(clippy::All)]
55-
| ^^^^^^^^^^^ help: did you mean: `clippy::all`
56-
57-
error: aborting due to 9 previous errors
51+
error: aborting due to 8 previous errors
5852

0 commit comments

Comments
 (0)