rust/tests/ui/reachable/unreachable-arm.rs

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

15 lines
285 B
Rust
Raw Normal View History

#![feature(box_patterns)]
#![allow(dead_code)]
#![deny(unreachable_patterns)]
enum Foo { A(Box<Foo>, isize), B(usize), }
fn main() {
match Foo::B(1) {
Foo::B(_) | Foo::A(box _, 1) => { }
2016-12-29 04:17:40 +00:00
Foo::A(_, 1) => { } //~ ERROR unreachable pattern
_ => { }
}
}