Amend compile-fail tests

This commit is contained in:
Andrew Cann 2016-12-29 12:17:40 +08:00
parent 5ba61edbd0
commit a1570828b2
2 changed files with 4 additions and 5 deletions

View File

@ -10,13 +10,14 @@
#![feature(slice_patterns)] #![feature(slice_patterns)]
#![deny(unreachable_patterns)] #![deny(unreachable_patterns)]
#![allow(unused_variables)]
fn main() { fn main() {
let x: Vec<(isize, isize)> = Vec::new(); let x: Vec<(isize, isize)> = Vec::new();
let x: &[(isize, isize)] = &x; let x: &[(isize, isize)] = &x;
match *x { match *x {
[_, (2, 3), _] => (), [a, (2, 3), _] => (),
[(1, 2), (2, 3), _] => (), //~ ERROR unreachable pattern [(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern
_ => () _ => ()
} }

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// error-pattern:unreachable pattern
#![feature(box_patterns)] #![feature(box_patterns)]
#![feature(box_syntax)] #![feature(box_syntax)]
#![allow(dead_code)] #![allow(dead_code)]
@ -20,7 +18,7 @@ enum Foo { A(Box<Foo>, isize), B(usize), }
fn main() { fn main() {
match Foo::B(1) { match Foo::B(1) {
Foo::B(_) | Foo::A(box _, 1) => { } Foo::B(_) | Foo::A(box _, 1) => { }
Foo::A(_, 1) => { } Foo::A(_, 1) => { } //~ ERROR unreachable pattern
_ => { } _ => { }
} }
} }