mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
15 lines
285 B
Rust
15 lines
285 B
Rust
#![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) => { }
|
|
Foo::A(_, 1) => { } //~ ERROR unreachable pattern
|
|
_ => { }
|
|
}
|
|
}
|