1
1
error: unreachable pattern
2
- --> $DIR/empty-match.rs:37 :9
2
+ --> $DIR/empty-match.rs:58 :9
3
3
|
4
4
LL | _ => {},
5
5
| ^
@@ -11,37 +11,52 @@ LL | #![deny(unreachable_patterns)]
11
11
| ^^^^^^^^^^^^^^^^^^^^
12
12
13
13
error: unreachable pattern
14
- --> $DIR/empty-match.rs:40 :9
14
+ --> $DIR/empty-match.rs:61 :9
15
15
|
16
16
LL | _ if false => {},
17
17
| ^
18
18
19
19
error: unreachable pattern
20
- --> $DIR/empty-match.rs:47 :9
20
+ --> $DIR/empty-match.rs:68 :9
21
21
|
22
22
LL | _ => {},
23
23
| ^
24
24
25
25
error: unreachable pattern
26
- --> $DIR/empty-match.rs:50 :9
26
+ --> $DIR/empty-match.rs:71 :9
27
27
|
28
28
LL | _ if false => {},
29
29
| ^
30
30
31
+ error[E0005]: refutable pattern in local binding
32
+ --> $DIR/empty-match.rs:76: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:88 :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:91 :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:109 :20
45
60
|
46
61
LL | match_no_arms!(0u8);
47
62
| ^^^
@@ -50,69 +65,69 @@ 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:111 :20
54
69
|
55
70
LL | match_no_arms!(NonEmptyStruct1);
56
71
| ^^^^^^^^^^^^^^^
57
72
|
58
73
note: `NonEmptyStruct1` defined here
59
- --> $DIR/empty-match.rs:14 :8
74
+ --> $DIR/empty-match.rs:15 :8
60
75
|
61
76
LL | struct NonEmptyStruct1;
62
77
| ^^^^^^^^^^^^^^^
63
78
= note: the matched value is of type `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:113 :20
68
83
|
69
84
LL | match_no_arms!(NonEmptyStruct2(true));
70
85
| ^^^^^^^^^^^^^^^^^^^^^
71
86
|
72
87
note: `NonEmptyStruct2` defined here
73
- --> $DIR/empty-match.rs:15 :8
88
+ --> $DIR/empty-match.rs:18 :8
74
89
|
75
90
LL | struct NonEmptyStruct2(bool);
76
91
| ^^^^^^^^^^^^^^^
77
92
= note: the matched value is of type `NonEmptyStruct2`
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:115 :20
82
97
|
83
98
LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
84
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
100
|
86
101
note: `NonEmptyUnion1` defined here
87
- --> $DIR/empty-match.rs:16 :7
102
+ --> $DIR/empty-match.rs:21 :7
88
103
|
89
104
LL | union NonEmptyUnion1 {
90
105
| ^^^^^^^^^^^^^^
91
106
= note: the matched value is of type `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:117 :20
96
111
|
97
112
LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
98
113
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
114
|
100
115
note: `NonEmptyUnion2` defined here
101
- --> $DIR/empty-match.rs:19 :7
116
+ --> $DIR/empty-match.rs:26 :7
102
117
|
103
118
LL | union NonEmptyUnion2 {
104
119
| ^^^^^^^^^^^^^^
105
120
= note: the matched value is of type `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:119 :20
110
125
|
111
126
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
112
127
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
113
128
|
114
129
note: `NonEmptyEnum1` defined here
115
- --> $DIR/empty-match.rs:24 :5
130
+ --> $DIR/empty-match.rs:33 :5
116
131
|
117
132
LL | enum NonEmptyEnum1 {
118
133
| -------------
@@ -122,39 +137,40 @@ 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:122 :20
126
141
|
127
142
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
128
143
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
129
144
|
130
145
note: `NonEmptyEnum2` defined here
131
- --> $DIR/empty-match.rs:27 :5
146
+ --> $DIR/empty-match.rs:40 :5
132
147
|
133
148
LL | enum NonEmptyEnum2 {
134
149
| -------------
135
150
LL | Foo(bool),
136
151
| ^^^ not covered
152
+ ...
137
153
LL | Bar,
138
154
| ^^^ not covered
139
155
= note: the matched value is of type `NonEmptyEnum2`
140
156
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
141
157
142
158
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
143
- --> $DIR/empty-match.rs:85 :20
159
+ --> $DIR/empty-match.rs:125 :20
144
160
|
145
161
LL | match_no_arms!(NonEmptyEnum5::V1);
146
162
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
147
163
|
148
164
note: `NonEmptyEnum5` defined here
149
- --> $DIR/empty-match.rs:30 :6
165
+ --> $DIR/empty-match.rs:49 :6
150
166
|
151
167
LL | enum NonEmptyEnum5 {
152
168
| ^^^^^^^^^^^^^
153
169
= note: the matched value is of type `NonEmptyEnum5`
154
170
= help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
155
171
156
172
error[E0004]: non-exhaustive patterns: `_` not covered
157
- --> $DIR/empty-match.rs:87 :24
173
+ --> $DIR/empty-match.rs:129 :24
158
174
|
159
175
LL | match_guarded_arm!(0u8);
160
176
| ^^^ pattern `_` not covered
@@ -167,13 +183,13 @@ LL + _ => todo!()
167
183
|
168
184
169
185
error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
170
- --> $DIR/empty-match.rs:88 :24
186
+ --> $DIR/empty-match.rs:133 :24
171
187
|
172
188
LL | match_guarded_arm!(NonEmptyStruct1);
173
189
| ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
174
190
|
175
191
note: `NonEmptyStruct1` defined here
176
- --> $DIR/empty-match.rs:14 :8
192
+ --> $DIR/empty-match.rs:15 :8
177
193
|
178
194
LL | struct NonEmptyStruct1;
179
195
| ^^^^^^^^^^^^^^^
@@ -185,13 +201,13 @@ LL + NonEmptyStruct1 => todo!()
185
201
|
186
202
187
203
error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
188
- --> $DIR/empty-match.rs:89 :24
204
+ --> $DIR/empty-match.rs:137 :24
189
205
|
190
206
LL | match_guarded_arm!(NonEmptyStruct2(true));
191
207
| ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
192
208
|
193
209
note: `NonEmptyStruct2` defined here
194
- --> $DIR/empty-match.rs:15 :8
210
+ --> $DIR/empty-match.rs:18 :8
195
211
|
196
212
LL | struct NonEmptyStruct2(bool);
197
213
| ^^^^^^^^^^^^^^^
@@ -203,13 +219,13 @@ LL + NonEmptyStruct2(_) => todo!()
203
219
|
204
220
205
221
error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
206
- --> $DIR/empty-match.rs:90 :24
222
+ --> $DIR/empty-match.rs:141 :24
207
223
|
208
224
LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
209
225
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
210
226
|
211
227
note: `NonEmptyUnion1` defined here
212
- --> $DIR/empty-match.rs:16 :7
228
+ --> $DIR/empty-match.rs:21 :7
213
229
|
214
230
LL | union NonEmptyUnion1 {
215
231
| ^^^^^^^^^^^^^^
@@ -221,13 +237,13 @@ LL + NonEmptyUnion1 { .. } => todo!()
221
237
|
222
238
223
239
error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
224
- --> $DIR/empty-match.rs:91 :24
240
+ --> $DIR/empty-match.rs:145 :24
225
241
|
226
242
LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
227
243
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
228
244
|
229
245
note: `NonEmptyUnion2` defined here
230
- --> $DIR/empty-match.rs:19 :7
246
+ --> $DIR/empty-match.rs:26 :7
231
247
|
232
248
LL | union NonEmptyUnion2 {
233
249
| ^^^^^^^^^^^^^^
@@ -239,13 +255,13 @@ LL + NonEmptyUnion2 { .. } => todo!()
239
255
|
240
256
241
257
error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
242
- --> $DIR/empty-match.rs:92 :24
258
+ --> $DIR/empty-match.rs:149 :24
243
259
|
244
260
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
245
261
| ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
246
262
|
247
263
note: `NonEmptyEnum1` defined here
248
- --> $DIR/empty-match.rs:24 :5
264
+ --> $DIR/empty-match.rs:33 :5
249
265
|
250
266
LL | enum NonEmptyEnum1 {
251
267
| -------------
@@ -259,18 +275,19 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
259
275
|
260
276
261
277
error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
262
- --> $DIR/empty-match.rs:93 :24
278
+ --> $DIR/empty-match.rs:153 :24
263
279
|
264
280
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
265
281
| ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
266
282
|
267
283
note: `NonEmptyEnum2` defined here
268
- --> $DIR/empty-match.rs:27 :5
284
+ --> $DIR/empty-match.rs:40 :5
269
285
|
270
286
LL | enum NonEmptyEnum2 {
271
287
| -------------
272
288
LL | Foo(bool),
273
289
| ^^^ not covered
290
+ ...
274
291
LL | Bar,
275
292
| ^^^ not covered
276
293
= note: the matched value is of type `NonEmptyEnum2`
@@ -281,13 +298,13 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
281
298
|
282
299
283
300
error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
284
- --> $DIR/empty-match.rs:94 :24
301
+ --> $DIR/empty-match.rs:157 :24
285
302
|
286
303
LL | match_guarded_arm!(NonEmptyEnum5::V1);
287
304
| ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
288
305
|
289
306
note: `NonEmptyEnum5` defined here
290
- --> $DIR/empty-match.rs:30 :6
307
+ --> $DIR/empty-match.rs:49 :6
291
308
|
292
309
LL | enum NonEmptyEnum5 {
293
310
| ^^^^^^^^^^^^^
@@ -298,6 +315,7 @@ LL ~ _ if false => {},
298
315
LL + _ => todo!()
299
316
|
300
317
301
- error: aborting due to 22 previous errors
318
+ error: aborting due to 23 previous errors
302
319
303
- For more information about this error, try `rustc --explain E0004`.
320
+ Some errors have detailed explanations: E0004, E0005.
321
+ For more information about an error, try `rustc --explain E0004`.
0 commit comments