-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandry
Treat unstable lints as unknown This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of rust-lang/compiler-team#469
- Loading branch information
Showing
21 changed files
with
383 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
// check-fail | ||
|
||
#![deny(non_exhaustive_omitted_patterns)] | ||
//~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
#![allow(non_exhaustive_omitted_patterns)] | ||
//~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
|
||
fn main() { | ||
enum Foo { | ||
A, B, C, | ||
} | ||
|
||
#[allow(non_exhaustive_omitted_patterns)] | ||
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
match Foo::A { | ||
Foo::A => {} | ||
Foo::B => {} | ||
} | ||
//~^^^^^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~^^^^ ERROR non-exhaustive patterns: `C` not covered | ||
|
||
match Foo::A { | ||
Foo::A => {} | ||
Foo::B => {} | ||
#[warn(non_exhaustive_omitted_patterns)] | ||
_ => {} | ||
} | ||
//~^^^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~^^^ WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns` | ||
} |
Oops, something went wrong.