summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/issue-72377.rs
blob: b5ad3075ca725410968cc48b1e97643a84719fe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[derive(PartialEq, Eq)]
enum X { A, B, C, }

fn main() {
    let x = X::A;
    let y = Some(X::A);

    match (x, y) {
        //~^ ERROR non-exhaustive patterns: `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2
        //~| more not covered
        (_, None) => false,
        (v, Some(w)) if v == w => true,
        (X::B, Some(X::C)) => false,
        (X::B, Some(X::A)) => false,
        (X::A, Some(X::C)) | (X::C, Some(X::A)) => false,
    };
}