rust/tests/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs
2023-01-11 09:32:08 +00:00

13 lines
199 B
Rust

enum A {
B { x: Option<isize> },
C
}
fn main() {
let x = A::B { x: Some(3) };
match x { //~ ERROR non-exhaustive patterns
A::C => {}
A::B { x: None } => {}
}
}