From a1570828b2b158afa755a5836b20c0fa5abc764a Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Thu, 29 Dec 2016 12:17:40 +0800 Subject: [PATCH] Amend compile-fail tests --- src/test/compile-fail/match-vec-unreachable.rs | 5 +++-- src/test/compile-fail/unreachable-arm.rs | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/compile-fail/match-vec-unreachable.rs index 6b8111ac313..472b054b087 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/compile-fail/match-vec-unreachable.rs @@ -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 _ => () } diff --git a/src/test/compile-fail/unreachable-arm.rs b/src/test/compile-fail/unreachable-arm.rs index 461f092b98b..df827d2c784 100644 --- a/src/test/compile-fail/unreachable-arm.rs +++ b/src/test/compile-fail/unreachable-arm.rs @@ -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)] @@ -20,7 +18,7 @@ enum Foo { A(Box, isize), B(usize), } fn main() { match Foo::B(1) { Foo::B(_) | Foo::A(box _, 1) => { } - Foo::A(_, 1) => { } + Foo::A(_, 1) => { } //~ ERROR unreachable pattern _ => { } } }