1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
15 match x { t::b => { } } //~ ERROR non-exhaustive patterns: `a` not covered
16 match true { //~ ERROR non-exhaustive patterns: `false` not covered
19 match Some(10i) { //~ ERROR non-exhaustive patterns: `Some(_)` not covered
22 match (2i, 3i, 4i) { //~ ERROR non-exhaustive patterns: `(_, _, _)` not covered
25 match (t::a, t::a) { //~ ERROR non-exhaustive patterns: `(a, a)` not covered
29 match t::a { //~ ERROR non-exhaustive patterns: `b` not covered
32 // This is exhaustive, though the algorithm got it wrong at one point
38 let vec = vec!(Some(42i), None, Some(21i));
39 let vec: &[Option<isize>] = vec.as_slice();
40 match vec { //~ ERROR non-exhaustive patterns: `[]` not covered
41 [Some(..), None, tail..] => {}
42 [Some(..), Some(..), tail..] => {}
46 let vec: &[isize] = vec.as_slice();
51 let vec = vec!(0.5f32);
52 let vec: &[f32] = vec.as_slice();
53 match vec { //~ ERROR non-exhaustive patterns: `[_, _, _, _]` not covered
54 [0.1, 0.2, 0.3] => (),
59 let vec = vec!(Some(42i), None, Some(21i));
60 let vec: &[Option<isize>] = vec.as_slice();
62 [Some(..), None, tail..] => {}
63 [Some(..), Some(..), tail..] => {}
64 [None, None, tail..] => {}
65 [None, Some(..), tail..] => {}