1 #![feature(slice_patterns)]
2 #![allow(illegal_floating_point_literal_pattern)]
8 match x { T::B => { } } //~ ERROR non-exhaustive patterns: `A` not covered
9 match true { //~ ERROR non-exhaustive patterns: `false` not covered
12 match Some(10) { //~ ERROR non-exhaustive patterns: `Some(_)` not covered
15 match (2, 3, 4) { //~ ERROR non-exhaustive patterns: `(_, _, -2147483648i32..=3i32)`
16 // and `(_, _, 5i32..=2147483647i32)` not covered
19 match (T::A, T::A) { //~ ERROR non-exhaustive patterns: `(A, A)` not covered
23 match T::A { //~ ERROR non-exhaustive patterns: `B` not covered
26 // This is exhaustive, though the algorithm got it wrong at one point
32 let vec = vec![Some(42), None, Some(21)];
33 let vec: &[Option<isize>] = &vec;
34 match *vec { //~ ERROR non-exhaustive patterns: `[]` not covered
35 [Some(..), None, ref tail @ ..] => {}
36 [Some(..), Some(..), ref tail @ ..] => {}
40 let vec: &[isize] = &vec;
42 [_, ref tail @ ..] => (),
45 let vec = vec![0.5f32];
46 let vec: &[f32] = &vec;
47 match *vec { //~ ERROR non-exhaustive patterns: `[_, _, _, _]` not covered
48 [0.1, 0.2, 0.3] => (),
53 let vec = vec![Some(42), None, Some(21)];
54 let vec: &[Option<isize>] = &vec;
56 [Some(..), None, ref tail @ ..] => {}
57 [Some(..), Some(..), ref tail @ ..] => {}
58 [None, None, ref tail @ ..] => {}
59 [None, Some(..), ref tail @ ..] => {}