2024-02-16 14:02:50 -06:00
|
|
|
//@ aux-build:non-exhaustive.rs
|
2023-08-28 01:25:52 -05:00
|
|
|
|
|
|
|
extern crate non_exhaustive;
|
|
|
|
|
|
|
|
use non_exhaustive::NonExhaustiveEnum;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match Some(NonExhaustiveEnum::A) {
|
|
|
|
//~^ ERROR non-exhaustive patterns: `Some(_)` not covered [E0004]
|
|
|
|
//~| NOTE pattern `Some(_)` not covered
|
|
|
|
//~| NOTE `Option<NonExhaustiveEnum>` defined here
|
|
|
|
//~| NOTE the matched value is of type `Option<NonExhaustiveEnum>`
|
|
|
|
//~| NOTE `NonExhaustiveEnum` is marked as non-exhaustive
|
|
|
|
Some(NonExhaustiveEnum::A) => {}
|
|
|
|
Some(NonExhaustiveEnum::B) => {}
|
|
|
|
None => {}
|
|
|
|
}
|
|
|
|
}
|