-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add feature gate to non_exhaustive_omitted_patterns lint
Actually add the feature to the lints ui test Add tracking issue to the feature declaration Rename feature gate to non_exhaustive_omitted_patterns_lint Add more omitted_patterns lint feature gate
- Loading branch information
Showing
7 changed files
with
154 additions
and
20 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
31 changes: 31 additions & 0 deletions
31
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#![deny(non_exhaustive_omitted_patterns)] | ||
//~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
#![allow(non_exhaustive_omitted_patterns)] | ||
//~^ ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
//~| ERROR the `non_exhaustive_omitted_patterns` lint is unstable | ||
|
||
fn main() { | ||
enum Foo { | ||
A, B, C, | ||
} | ||
|
||
#[allow(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 | ||
|
||
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 | ||
} |
93 changes: 93 additions & 0 deletions
93
src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:1:1 | ||
| | ||
LL | #![deny(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:4:1 | ||
| | ||
LL | #![allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:13:5 | ||
| | ||
LL | #[allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:13:5 | ||
| | ||
LL | #[allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:26:9 | ||
| | ||
LL | #[warn(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:1:1 | ||
| | ||
LL | #![deny(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:4:1 | ||
| | ||
LL | #![allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:13:5 | ||
| | ||
LL | #[allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:13:5 | ||
| | ||
LL | #[allow(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error[E0658]: the `non_exhaustive_omitted_patterns` lint is unstable | ||
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:26:9 | ||
| | ||
LL | #[warn(non_exhaustive_omitted_patterns)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information | ||
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable | ||
|
||
error: aborting due to 10 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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