rust/tests/ui/pattern/usefulness/struct-pattern-match-useless.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
238 B
Rust
Raw Normal View History

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