Skip to content

Commit a157082

Browse files
committed
Amend compile-fail tests
1 parent 5ba61ed commit a157082

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/test/compile-fail/match-vec-unreachable.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
#![feature(slice_patterns)]
1212
#![deny(unreachable_patterns)]
13+
#![allow(unused_variables)]
1314

1415
fn main() {
1516
let x: Vec<(isize, isize)> = Vec::new();
1617
let x: &[(isize, isize)] = &x;
1718
match *x {
18-
[_, (2, 3), _] => (),
19-
[(1, 2), (2, 3), _] => (), //~ ERROR unreachable pattern
19+
[a, (2, 3), _] => (),
20+
[(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern
2021
_ => ()
2122
}
2223

src/test/compile-fail/unreachable-arm.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:unreachable pattern
12-
1311
#![feature(box_patterns)]
1412
#![feature(box_syntax)]
1513
#![allow(dead_code)]
@@ -20,7 +18,7 @@ enum Foo { A(Box<Foo>, isize), B(usize), }
2018
fn main() {
2119
match Foo::B(1) {
2220
Foo::B(_) | Foo::A(box _, 1) => { }
23-
Foo::A(_, 1) => { }
21+
Foo::A(_, 1) => { } //~ ERROR unreachable pattern
2422
_ => { }
2523
}
2624
}

0 commit comments

Comments
 (0)