Fix test I broke

This commit is contained in:
Andrew Cann 2016-12-11 22:23:18 +08:00
parent 56f355c83a
commit f8c4d10e95

View File

@ -10,6 +10,9 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![deny(unreachable_patterns)]
enum IntList {
Cons(isize, Box<IntList>),
@ -19,9 +22,8 @@ enum IntList {
fn tail(source_list: &IntList) -> IntList {
match source_list {
&IntList::Cons(val, box ref next_list) => tail(next_list),
&IntList::Cons(val, box Nil) => IntList::Cons(val, box Nil),
//~^ ERROR cannot move out of borrowed content
//~^^ WARN pattern binding `Nil` is named the same as one of the variants of the type `IntList`
&IntList::Cons(val, box IntList::Nil) => IntList::Cons(val, box IntList::Nil),
//~^ ERROR unreachable pattern
_ => panic!()
}
}