3 second: Option<[usize; 4]>
6 fn struct_with_a_nested_enum_and_vector() {
7 match (Foo { first: true, second: None }) {
8 //~^ ERROR non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered
9 Foo { first: true, second: None } => (),
10 Foo { first: true, second: Some(_) } => (),
11 Foo { first: false, second: None } => (),
12 Foo { first: false, second: Some([1, 2, 3, 4]) } => ()
19 CustomRGBA { a: bool, r: u8, g: u8, b: u8 }
22 fn enum_with_single_missing_variant() {
24 //~^ ERROR non-exhaustive patterns: `Red` not covered
25 Color::CustomRGBA { .. } => (),
31 North, East, South, West
34 fn enum_with_multiple_missing_variants() {
35 match Direction::North {
36 //~^ ERROR non-exhaustive patterns: `East`, `South` and `West` not covered
37 Direction::North => ()
42 First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth, Eleventh, Twelfth
45 fn enum_with_excessive_missing_variants() {
46 match ExcessiveEnum::First {
47 //~^ ERROR `Second`, `Third`, `Fourth` and 8 more not covered
49 ExcessiveEnum::First => ()
53 fn enum_struct_variant() {
55 //~^ ERROR non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered
58 Color::CustomRGBA { a: false, r: _, g: _, b: 0 } => (),
59 Color::CustomRGBA { a: false, r: _, g: _, b: _ } => ()
68 fn vectors_with_nested_enums() {
69 let x: &'static [Enum] = &[Enum::First, Enum::Second(false)];
71 //~^ ERROR non-exhaustive patterns: `[Second(true), Second(false)]` not covered
74 [Enum::First, _] => (),
75 [Enum::Second(true), Enum::First] => (),
76 [Enum::Second(true), Enum::Second(true)] => (),
77 [Enum::Second(false), _] => (),
78 [_, _, ref tail @ .., _] => ()
84 //~^ ERROR non-exhaustive patterns: `((), false)` not covered