1
- error[E0004]: non-exhaustive patterns: `_` not covered
2
- --> $DIR/match-empty.rs:49:11
1
+ error: unreachable pattern
2
+ --> $DIR/match-empty.rs:47:9
3
3
|
4
- LL | enum Foo {}
5
- | ----------- `Foo` defined here
6
- ...
7
- LL | match x {
8
- | ^ pattern `_` not covered
4
+ LL | _ => {},
5
+ | ^
9
6
|
10
- = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
11
- = note: the matched value is of type `Foo`
7
+ note: the lint level is defined here
8
+ --> $DIR/match-empty.rs:3:9
9
+ |
10
+ LL | #![deny(unreachable_patterns)]
11
+ | ^^^^^^^^^^^^^^^^^^^^
12
12
13
- error[E0004]: non-exhaustive patterns: `_` not covered
14
- --> $DIR/match-empty.rs:60:11
13
+ error: unreachable pattern
14
+ --> $DIR/match-empty.rs:50:9
15
15
|
16
- LL | match x {
17
- | ^ pattern `_` not covered
16
+ LL | _ if false => {},
17
+ | ^
18
+
19
+ error: unreachable pattern
20
+ --> $DIR/match-empty.rs:57:9
18
21
|
19
- = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
20
- = note: the matched value is of type `!`
22
+ LL | _ => {},
23
+ | ^
24
+
25
+ error: unreachable pattern
26
+ --> $DIR/match-empty.rs:60:9
27
+ |
28
+ LL | _ if false => {},
29
+ | ^
21
30
22
31
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
23
- --> $DIR/match-empty.rs:77 :18
32
+ --> $DIR/match-empty.rs:75 :18
24
33
|
25
34
LL | match_empty!(0u8);
26
35
| ^^^
@@ -29,7 +38,7 @@ LL | match_empty!(0u8);
29
38
= note: the matched value is of type `u8`
30
39
31
40
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct` is non-empty
32
- --> $DIR/match-empty.rs:79 :18
41
+ --> $DIR/match-empty.rs:77 :18
33
42
|
34
43
LL | struct NonEmptyStruct(bool);
35
44
| ---------------------------- `NonEmptyStruct` defined here
@@ -41,7 +50,7 @@ LL | match_empty!(NonEmptyStruct(true));
41
50
= note: the matched value is of type `NonEmptyStruct`
42
51
43
52
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
44
- --> $DIR/match-empty.rs:81 :18
53
+ --> $DIR/match-empty.rs:79 :18
45
54
|
46
55
LL | / union NonEmptyUnion1 {
47
56
LL | | foo: (),
@@ -55,7 +64,7 @@ LL | match_empty!((NonEmptyUnion1 { foo: () }));
55
64
= note: the matched value is of type `NonEmptyUnion1`
56
65
57
66
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
58
- --> $DIR/match-empty.rs:83 :18
67
+ --> $DIR/match-empty.rs:81 :18
59
68
|
60
69
LL | / union NonEmptyUnion2 {
61
70
LL | | foo: (),
@@ -70,7 +79,7 @@ LL | match_empty!((NonEmptyUnion2 { foo: () }));
70
79
= note: the matched value is of type `NonEmptyUnion2`
71
80
72
81
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
73
- --> $DIR/match-empty.rs:85 :18
82
+ --> $DIR/match-empty.rs:83 :18
74
83
|
75
84
LL | / enum NonEmptyEnum1 {
76
85
LL | | Foo(bool),
@@ -87,7 +96,7 @@ LL | match_empty!(NonEmptyEnum1::Foo(true));
87
96
= note: the matched value is of type `NonEmptyEnum1`
88
97
89
98
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
90
- --> $DIR/match-empty.rs:87 :18
99
+ --> $DIR/match-empty.rs:85 :18
91
100
|
92
101
LL | / enum NonEmptyEnum2 {
93
102
LL | | Foo(bool),
@@ -108,7 +117,7 @@ LL | match_empty!(NonEmptyEnum2::Foo(true));
108
117
= note: the matched value is of type `NonEmptyEnum2`
109
118
110
119
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
111
- --> $DIR/match-empty.rs:89 :18
120
+ --> $DIR/match-empty.rs:87 :18
112
121
|
113
122
LL | / enum NonEmptyEnum5 {
114
123
LL | | V1, V2, V3, V4, V5,
@@ -122,7 +131,7 @@ LL | match_empty!(NonEmptyEnum5::V1);
122
131
= note: the matched value is of type `NonEmptyEnum5`
123
132
124
133
error[E0004]: non-exhaustive patterns: `_` not covered
125
- --> $DIR/match-empty.rs:92 :18
134
+ --> $DIR/match-empty.rs:90 :18
126
135
|
127
136
LL | match_false!(0u8);
128
137
| ^^^ pattern `_` not covered
@@ -131,7 +140,7 @@ LL | match_false!(0u8);
131
140
= note: the matched value is of type `u8`
132
141
133
142
error[E0004]: non-exhaustive patterns: `NonEmptyStruct(_)` not covered
134
- --> $DIR/match-empty.rs:94 :18
143
+ --> $DIR/match-empty.rs:92 :18
135
144
|
136
145
LL | struct NonEmptyStruct(bool);
137
146
| ---------------------------- `NonEmptyStruct` defined here
@@ -143,7 +152,7 @@ LL | match_false!(NonEmptyStruct(true));
143
152
= note: the matched value is of type `NonEmptyStruct`
144
153
145
154
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
146
- --> $DIR/match-empty.rs:96 :18
155
+ --> $DIR/match-empty.rs:94 :18
147
156
|
148
157
LL | / union NonEmptyUnion1 {
149
158
LL | | foo: (),
@@ -157,7 +166,7 @@ LL | match_false!((NonEmptyUnion1 { foo: () }));
157
166
= note: the matched value is of type `NonEmptyUnion1`
158
167
159
168
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
160
- --> $DIR/match-empty.rs:98 :18
169
+ --> $DIR/match-empty.rs:96 :18
161
170
|
162
171
LL | / union NonEmptyUnion2 {
163
172
LL | | foo: (),
@@ -172,7 +181,7 @@ LL | match_false!((NonEmptyUnion2 { foo: () }));
172
181
= note: the matched value is of type `NonEmptyUnion2`
173
182
174
183
error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
175
- --> $DIR/match-empty.rs:100 :18
184
+ --> $DIR/match-empty.rs:98 :18
176
185
|
177
186
LL | / enum NonEmptyEnum1 {
178
187
LL | | Foo(bool),
@@ -189,7 +198,7 @@ LL | match_false!(NonEmptyEnum1::Foo(true));
189
198
= note: the matched value is of type `NonEmptyEnum1`
190
199
191
200
error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
192
- --> $DIR/match-empty.rs:102 :18
201
+ --> $DIR/match-empty.rs:100 :18
193
202
|
194
203
LL | / enum NonEmptyEnum2 {
195
204
LL | | Foo(bool),
@@ -210,7 +219,7 @@ LL | match_false!(NonEmptyEnum2::Foo(true));
210
219
= note: the matched value is of type `NonEmptyEnum2`
211
220
212
221
error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
213
- --> $DIR/match-empty.rs:104 :18
222
+ --> $DIR/match-empty.rs:102 :18
214
223
|
215
224
LL | / enum NonEmptyEnum5 {
216
225
LL | | V1, V2, V3, V4, V5,
@@ -223,6 +232,6 @@ LL | match_false!(NonEmptyEnum5::V1);
223
232
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
224
233
= note: the matched value is of type `NonEmptyEnum5`
225
234
226
- error: aborting due to 16 previous errors
235
+ error: aborting due to 18 previous errors
227
236
228
237
For more information about this error, try `rustc --explain E0004`.
0 commit comments