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 { b => { } } //~ ERROR non-exhaustive patterns
16 match true { //~ ERROR non-exhaustive patterns
19 match Some(10) { //~ ERROR non-exhaustive patterns
22 match (2, 3, 4) { //~ ERROR non-exhaustive patterns
25 match (a, a) { //~ ERROR non-exhaustive patterns
29 match a { //~ ERROR b not covered
32 // This is exhaustive, though the algorithm got it wrong at one point
38 let vec = vec!(Some(42), None, Some(21));
39 let vec: &[Option<int>] = vec;
41 //~^ ERROR non-exhaustive patterns: vectors of length 0 not covered
42 [Some(..), None, ..tail] => {}
43 [Some(..), Some(..), ..tail] => {}
47 let vec: &[int] = vec;
53 let vec: &[f32] = vec;
54 match vec { //~ ERROR non-exhaustive patterns: vectors of length 4 not covered
55 [0.1, 0.2, 0.3] => (),
60 let vec = vec!(Some(42), None, Some(21));
61 let vec: &[Option<int>] = vec;
63 [Some(..), None, ..tail] => {}
64 [Some(..), Some(..), ..tail] => {}
65 [None, None, ..tail] => {}
66 [None, Some(..), ..tail] => {}