2015-02-10 22:52:00 +01:00
|
|
|
#![feature(box_patterns)]
|
2021-08-25 02:39:40 +02:00
|
|
|
|
2016-11-29 15:10:26 +08:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![deny(unreachable_patterns)]
|
2011-07-25 13:45:09 +02:00
|
|
|
|
2016-11-29 15:10:26 +08:00
|
|
|
enum Foo { A(Box<Foo>, isize), B(usize), }
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match Foo::B(1) {
|
|
|
|
Foo::B(_) | Foo::A(box _, 1) => { }
|
2016-12-29 12:17:40 +08:00
|
|
|
Foo::A(_, 1) => { } //~ ERROR unreachable pattern
|
2016-11-29 15:10:26 +08:00
|
|
|
_ => { }
|
|
|
|
}
|
|
|
|
}
|