Skip to content

Commit

Permalink
Amend compile-fail tests
Browse files Browse the repository at this point in the history
  • Loading branch information
canndrew committed Jan 3, 2017
1 parent 5ba61ed commit a157082
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/test/compile-fail/match-vec-unreachable.rs
Expand Up @@ -10,13 +10,14 @@

#![feature(slice_patterns)]
#![deny(unreachable_patterns)]
#![allow(unused_variables)]

fn main() {
let x: Vec<(isize, isize)> = Vec::new();
let x: &[(isize, isize)] = &x;
match *x {
[_, (2, 3), _] => (),
[(1, 2), (2, 3), _] => (), //~ ERROR unreachable pattern
[a, (2, 3), _] => (),
[(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern
_ => ()
}

Expand Down
4 changes: 1 addition & 3 deletions src/test/compile-fail/unreachable-arm.rs
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern:unreachable pattern

#![feature(box_patterns)]
#![feature(box_syntax)]
#![allow(dead_code)]
Expand All @@ -20,7 +18,7 @@ enum Foo { A(Box<Foo>, isize), B(usize), }
fn main() {
match Foo::B(1) {
Foo::B(_) | Foo::A(box _, 1) => { }
Foo::A(_, 1) => { }
Foo::A(_, 1) => { } //~ ERROR unreachable pattern
_ => { }
}
}
Expand Down

0 comments on commit a157082

Please sign in to comment.