]>
Commit | Line | Data |
---|---|---|
85aaf69f | 1 | #![feature(box_patterns)] |
32a655c1 SL |
2 | #![allow(dead_code)] |
3 | #![allow(unused_variables)] | |
4 | #![deny(unreachable_patterns)] | |
1a4d82fc | 5 | |
c295e0f8 | 6 | |
1a4d82fc JJ |
7 | enum IntList { |
8 | Cons(isize, Box<IntList>), | |
9 | Nil | |
10 | } | |
11 | ||
12 | fn tail(source_list: &IntList) -> IntList { | |
13 | match source_list { | |
14 | &IntList::Cons(val, box ref next_list) => tail(next_list), | |
c295e0f8 XL |
15 | &IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, Box::new(IntList::Nil)), |
16 | //~^ ERROR unreachable pattern | |
17 | _ => panic!(), | |
1a4d82fc JJ |
18 | } |
19 | } | |
20 | ||
21 | fn main() {} |