]> git.proxmox.com Git - rustc.git/blob - tests/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / pattern / usefulness / non-exhaustive-pattern-witness.stderr
1 error[E0004]: non-exhaustive patterns: `Foo { first: false, second: Some([_, _, _, _]) }` not covered
2 --> $DIR/non-exhaustive-pattern-witness.rs:7:11
3 |
4 LL | match (Foo { first: true, second: None }) {
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { first: false, second: Some([_, _, _, _]) }` not covered
6 |
7 note: `Foo` defined here
8 --> $DIR/non-exhaustive-pattern-witness.rs:1:8
9 |
10 LL | struct Foo {
11 | ^^^
12 = note: the matched value is of type `Foo`
13 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14 |
15 LL ~ Foo { first: false, second: Some([1, 2, 3, 4]) } => (),
16 LL + Foo { first: false, second: Some([_, _, _, _]) } => todo!()
17 |
18
19 error[E0004]: non-exhaustive patterns: `Color::Red` not covered
20 --> $DIR/non-exhaustive-pattern-witness.rs:23:11
21 |
22 LL | match Color::Red {
23 | ^^^^^^^^^^ pattern `Color::Red` not covered
24 |
25 note: `Color` defined here
26 --> $DIR/non-exhaustive-pattern-witness.rs:17:5
27 |
28 LL | enum Color {
29 | -----
30 LL | Red,
31 | ^^^ not covered
32 = note: the matched value is of type `Color`
33 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
34 |
35 LL ~ Color::Green => (),
36 LL + Color::Red => todo!()
37 |
38
39 error[E0004]: non-exhaustive patterns: `Direction::East`, `Direction::South` and `Direction::West` not covered
40 --> $DIR/non-exhaustive-pattern-witness.rs:35:11
41 |
42 LL | match Direction::North {
43 | ^^^^^^^^^^^^^^^^ patterns `Direction::East`, `Direction::South` and `Direction::West` not covered
44 |
45 note: `Direction` defined here
46 --> $DIR/non-exhaustive-pattern-witness.rs:31:12
47 |
48 LL | enum Direction {
49 | ---------
50 LL | North, East, South, West
51 | ^^^^ ^^^^^ ^^^^ not covered
52 | | |
53 | | not covered
54 | not covered
55 = note: the matched value is of type `Direction`
56 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
57 |
58 LL ~ Direction::North => (),
59 LL + Direction::East | Direction::South | Direction::West => todo!()
60 |
61
62 error[E0004]: non-exhaustive patterns: `ExcessiveEnum::Second`, `ExcessiveEnum::Third`, `ExcessiveEnum::Fourth` and 8 more not covered
63 --> $DIR/non-exhaustive-pattern-witness.rs:46:11
64 |
65 LL | match ExcessiveEnum::First {
66 | ^^^^^^^^^^^^^^^^^^^^ patterns `ExcessiveEnum::Second`, `ExcessiveEnum::Third`, `ExcessiveEnum::Fourth` and 8 more not covered
67 |
68 note: `ExcessiveEnum` defined here
69 --> $DIR/non-exhaustive-pattern-witness.rs:41:6
70 |
71 LL | enum ExcessiveEnum {
72 | ^^^^^^^^^^^^^
73 = note: the matched value is of type `ExcessiveEnum`
74 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
75 |
76 LL ~ ExcessiveEnum::First => (),
77 LL + _ => todo!()
78 |
79
80 error[E0004]: non-exhaustive patterns: `Color::CustomRGBA { a: true, .. }` not covered
81 --> $DIR/non-exhaustive-pattern-witness.rs:54:11
82 |
83 LL | match Color::Red {
84 | ^^^^^^^^^^ pattern `Color::CustomRGBA { a: true, .. }` not covered
85 |
86 note: `Color` defined here
87 --> $DIR/non-exhaustive-pattern-witness.rs:19:5
88 |
89 LL | enum Color {
90 | -----
91 ...
92 LL | CustomRGBA { a: bool, r: u8, g: u8, b: u8 }
93 | ^^^^^^^^^^ not covered
94 = note: the matched value is of type `Color`
95 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
96 |
97 LL ~ Color::CustomRGBA { a: false, r: _, g: _, b: _ } => (),
98 LL + Color::CustomRGBA { a: true, .. } => todo!()
99 |
100
101 error[E0004]: non-exhaustive patterns: `[Enum::Second(true), Enum::Second(false)]` not covered
102 --> $DIR/non-exhaustive-pattern-witness.rs:70:11
103 |
104 LL | match *x {
105 | ^^ pattern `[Enum::Second(true), Enum::Second(false)]` not covered
106 |
107 = note: the matched value is of type `[Enum]`
108 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
109 |
110 LL ~ [_, _, ref tail @ .., _] => (),
111 LL + [Enum::Second(true), Enum::Second(false)] => todo!()
112 |
113
114 error[E0004]: non-exhaustive patterns: `((), false)` not covered
115 --> $DIR/non-exhaustive-pattern-witness.rs:83:11
116 |
117 LL | match ((), false) {
118 | ^^^^^^^^^^^ pattern `((), false)` not covered
119 |
120 = note: the matched value is of type `((), bool)`
121 help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
122 |
123 LL ~ ((), true) => (),
124 LL + ((), false) => todo!()
125 |
126
127 error: aborting due to 7 previous errors
128
129 For more information about this error, try `rustc --explain E0004`.