mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
// check-fail
|
|
|
|
#![deny(non_exhaustive_omitted_patterns)]
|
|
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
#![allow(non_exhaustive_omitted_patterns)]
|
|
//~^ 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 non-exhaustive patterns: `Foo::C` not covered
|
|
|
|
match Foo::A {
|
|
Foo::A => {}
|
|
Foo::B => {}
|
|
#[warn(non_exhaustive_omitted_patterns)]
|
|
_ => {}
|
|
}
|
|
//~^^^ WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
}
|