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`
|
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`
|
2021-10-01 09:21:56 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
enum Foo {
|
2023-10-14 08:19:51 -05:00
|
|
|
A,
|
|
|
|
B,
|
|
|
|
C,
|
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
|
|
|
match Foo::A {
|
2023-10-14 11:25:10 -05:00
|
|
|
//~^ ERROR non-exhaustive patterns: `Foo::C` not covered
|
2021-10-01 09:21:56 -05:00
|
|
|
Foo::A => {}
|
|
|
|
Foo::B => {}
|
|
|
|
}
|
|
|
|
|
2023-10-14 08:19:51 -05:00
|
|
|
#[warn(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 => {}
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|