@@ -28,20 +28,35 @@ error: unreachable pattern
28
28
LL | _ if false => {},
29
29
| ^
30
30
31
+ error[E0005]: refutable pattern in local binding
32
+ --> $DIR/empty-match.rs:55:9
33
+ |
34
+ LL | let None = x;
35
+ | ^^^^ pattern `Some(_)` not covered
36
+ |
37
+ = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
38
+ = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
39
+ = note: pattern `Some(_)` is currently uninhabited, but this variant contains private fields which may become inhabited in the future
40
+ = note: the matched value is of type `Option<SecretlyUninhabitedForeignStruct>`
41
+ help: you might want to use `if let` to ignore the variant that isn't matched
42
+ |
43
+ LL | if let None = x { todo!() };
44
+ | ++ +++++++++++
45
+
31
46
error: unreachable pattern
32
- --> $DIR/empty-match.rs:57 :9
47
+ --> $DIR/empty-match.rs:61 :9
33
48
|
34
49
LL | _ => {},
35
50
| ^
36
51
37
52
error: unreachable pattern
38
- --> $DIR/empty-match.rs:60 :9
53
+ --> $DIR/empty-match.rs:64 :9
39
54
|
40
55
LL | _ if false => {},
41
56
| ^
42
57
43
58
error[E0004]: non-exhaustive patterns: type `u8` is non-empty
44
- --> $DIR/empty-match.rs:78 :20
59
+ --> $DIR/empty-match.rs:82 :20
45
60
|
46
61
LL | match_no_arms!(0u8);
47
62
| ^^^
@@ -50,7 +65,7 @@ LL | match_no_arms!(0u8);
50
65
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
51
66
52
67
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
53
- --> $DIR/empty-match.rs:79 :20
68
+ --> $DIR/empty-match.rs:83 :20
54
69
|
55
70
LL | match_no_arms!(NonEmptyStruct1);
56
71
| ^^^^^^^^^^^^^^^
@@ -64,7 +79,7 @@ LL | struct NonEmptyStruct1;
64
79
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
65
80
66
81
error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
67
- --> $DIR/empty-match.rs:80 :20
82
+ --> $DIR/empty-match.rs:84 :20
68
83
|
69
84
LL | match_no_arms!(NonEmptyStruct2(true));
70
85
| ^^^^^^^^^^^^^^^^^^^^^
@@ -78,7 +93,7 @@ LL | struct NonEmptyStruct2(bool);
78
93
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
79
94
80
95
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
81
- --> $DIR/empty-match.rs:81 :20
96
+ --> $DIR/empty-match.rs:85 :20
82
97
|
83
98
LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
84
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,7 +107,7 @@ LL | union NonEmptyUnion1 {
92
107
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
93
108
94
109
error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
95
- --> $DIR/empty-match.rs:82 :20
110
+ --> $DIR/empty-match.rs:86 :20
96
111
|
97
112
LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
98
113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,7 +121,7 @@ LL | union NonEmptyUnion2 {
106
121
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
107
122
108
123
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
109
- --> $DIR/empty-match.rs:83 :20
124
+ --> $DIR/empty-match.rs:87 :20
110
125
|
111
126
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
112
127
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -122,7 +137,7 @@ LL | Foo(bool),
122
137
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
123
138
124
139
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
125
- --> $DIR/empty-match.rs:84 :20
140
+ --> $DIR/empty-match.rs:88 :20
126
141
|
127
142
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
128
143
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -140,7 +155,7 @@ LL | Bar,
140
155
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
141
156
142
157
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
143
- --> $DIR/empty-match.rs:85 :20
158
+ --> $DIR/empty-match.rs:89 :20
144
159
|
145
160
LL | match_no_arms!(NonEmptyEnum5::V1);
146
161
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -154,7 +169,7 @@ LL | enum NonEmptyEnum5 {
154
169
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
155
170
156
171
error[E0004]: non-exhaustive patterns: `_` not covered
157
- --> $DIR/empty-match.rs:87 :24
172
+ --> $DIR/empty-match.rs:91 :24
158
173
|
159
174
LL | match_guarded_arm!(0u8);
160
175
| ^^^ pattern `_` not covered
@@ -167,7 +182,7 @@ LL + _ => todo!()
167
182
|
168
183
169
184
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
170
- --> $DIR/empty-match.rs:88 :24
185
+ --> $DIR/empty-match.rs:92 :24
171
186
|
172
187
LL | match_guarded_arm!(NonEmptyStruct1);
173
188
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -185,7 +200,7 @@ LL + NonEmptyStruct1 => todo!()
185
200
|
186
201
187
202
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
188
- --> $DIR/empty-match.rs:89 :24
203
+ --> $DIR/empty-match.rs:93 :24
189
204
|
190
205
LL | match_guarded_arm!(NonEmptyStruct2(true));
191
206
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -203,7 +218,7 @@ LL + NonEmptyStruct2(_) => todo!()
203
218
|
204
219
205
220
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
206
- --> $DIR/empty-match.rs:90 :24
221
+ --> $DIR/empty-match.rs:94 :24
207
222
|
208
223
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
209
224
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -221,7 +236,7 @@ LL + NonEmptyUnion1 { .. } => todo!()
221
236
|
222
237
223
238
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
224
- --> $DIR/empty-match.rs:91 :24
239
+ --> $DIR/empty-match.rs:95 :24
225
240
|
226
241
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
227
242
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -239,7 +254,7 @@ LL + NonEmptyUnion2 { .. } => todo!()
239
254
|
240
255
241
256
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
242
- --> $DIR/empty-match.rs:92 :24
257
+ --> $DIR/empty-match.rs:96 :24
243
258
|
244
259
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
245
260
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -259,7 +274,7 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
259
274
|
260
275
261
276
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
262
- --> $DIR/empty-match.rs:93 :24
277
+ --> $DIR/empty-match.rs:97 :24
263
278
|
264
279
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
265
280
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -281,7 +296,7 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
281
296
|
282
297
283
298
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
284
- --> $DIR/empty-match.rs:94 :24
299
+ --> $DIR/empty-match.rs:98 :24
285
300
|
286
301
LL | match_guarded_arm!(NonEmptyEnum5::V1);
287
302
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -298,6 +313,7 @@ LL ~ _ if false => {},
298
313
LL + _ => todo!()
299
314
|
300
315
301
- error: aborting due to 22 previous errors
316
+ error: aborting due to 23 previous errors
302
317
303
- For more information about this error, try `rustc --explain E0004`.
318
+ Some errors have detailed explanations: E0004, E0005.
319
+ For more information about an error, try `rustc --explain E0004`.
0 commit comments