]> git.proxmox.com Git - rustc.git/blob - tests/ui/pattern/usefulness/nested-non-exhaustive-enums.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / pattern / usefulness / nested-non-exhaustive-enums.rs
1 // aux-build:non-exhaustive.rs
2
3 extern crate non_exhaustive;
4
5 use non_exhaustive::NonExhaustiveEnum;
6
7 fn main() {
8 match Some(NonExhaustiveEnum::A) {
9 //~^ ERROR non-exhaustive patterns: `Some(_)` not covered [E0004]
10 //~| NOTE pattern `Some(_)` not covered
11 //~| NOTE `Option<NonExhaustiveEnum>` defined here
12 //~| NOTE the matched value is of type `Option<NonExhaustiveEnum>`
13 //~| NOTE `NonExhaustiveEnum` is marked as non-exhaustive
14 Some(NonExhaustiveEnum::A) => {}
15 Some(NonExhaustiveEnum::B) => {}
16 None => {}
17 }
18 }