summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/struct-pattern-match-useless.rs
blob: 93f0a9317616926cf7d2d99681a05de04ac8c6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![deny(unreachable_patterns)]

struct Foo {
    x: isize,
    y: isize,
}

pub fn main() {
    let a = Foo { x: 1, y: 2 };
    match a {
        Foo { x: _x, y: _y } => (),
        Foo { .. } => () //~ ERROR unreachable pattern
    }

}