]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/struct-pattern-match-useless.rs
Rollup merge of #80298 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomez
[rust.git] / src / test / ui / pattern / usefulness / struct-pattern-match-useless.rs
1 #![deny(unreachable_patterns)]
2
3 struct Foo {
4     x: isize,
5     y: isize,
6 }
7
8 pub fn main() {
9     let a = Foo { x: 1, y: 2 };
10     match a {
11         Foo { x: _x, y: _y } => (),
12         Foo { .. } => () //~ ERROR unreachable pattern
13     }
14
15 }