2022-02-28 14:29:06 -06:00
|
|
|
// check-fail
|
|
|
|
|
2021-10-01 09:21:56 -05:00
|
|
|
#![deny(non_exhaustive_omitted_patterns)]
|
2022-02-28 14:29:06 -06:00
|
|
|
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
|
|
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
2021-10-01 09:21:56 -05:00
|
|
|
#![allow(non_exhaustive_omitted_patterns)]
|
2022-02-28 14:29:06 -06:00
|
|
|
//~^ WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
|
|
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
2021-10-01 09:21:56 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
enum Foo {
|
|
|
|
A, B, C,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(non_exhaustive_omitted_patterns)]
|
2022-02-28 14:29:06 -06:00
|
|
|
//~^ 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`
|
2021-10-01 09:21:56 -05:00
|
|
|
match Foo::A {
|
|
|
|
Foo::A => {}
|
|
|
|
Foo::B => {}
|
|
|
|
}
|
2022-09-02 22:01:35 -05:00
|
|
|
//~^^^^ ERROR non-exhaustive patterns: `Foo::C` not covered
|
2021-10-01 09:21:56 -05:00
|
|
|
|
|
|
|
match Foo::A {
|
|
|
|
Foo::A => {}
|
|
|
|
Foo::B => {}
|
|
|
|
#[warn(non_exhaustive_omitted_patterns)]
|
|
|
|
_ => {}
|
|
|
|
}
|
2022-02-28 14:29:06 -06:00
|
|
|
//~^^^ WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
|
|
|
//~| WARNING unknown lint: `non_exhaustive_omitted_patterns`
|
2021-10-01 09:21:56 -05:00
|
|
|
}
|