summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.rs
blob: b1fc0f5ad3e1478989e983728df273d6a8404964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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 } => {}
    }
}