rust/src/test/compile-fail/struct-like-enum-nonexhaustive.rs

15 lines
190 B
Rust

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