rust/src/test/ui/structs/struct-pattern-match-useless.rs
2018-12-25 21:08:33 -07:00

15 lines
238 B
Rust

#![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
}
}