11error: unreachable pattern
2- --> $DIR/empty-match.rs:37 :9
2+ --> $DIR/empty-match.rs:58 :9
33 |
44LL | _ => {},
55 | ^
@@ -11,37 +11,52 @@ LL | #![deny(unreachable_patterns)]
1111 | ^^^^^^^^^^^^^^^^^^^^
1212
1313error: unreachable pattern
14- --> $DIR/empty-match.rs:40 :9
14+ --> $DIR/empty-match.rs:61 :9
1515 |
1616LL | _ if false => {},
1717 | ^
1818
1919error: unreachable pattern
20- --> $DIR/empty-match.rs:47 :9
20+ --> $DIR/empty-match.rs:68 :9
2121 |
2222LL | _ => {},
2323 | ^
2424
2525error: unreachable pattern
26- --> $DIR/empty-match.rs:50 :9
26+ --> $DIR/empty-match.rs:71 :9
2727 |
2828LL | _ if false => {},
2929 | ^
3030
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+
3146error: unreachable pattern
32- --> $DIR/empty-match.rs:57 :9
47+ --> $DIR/empty-match.rs:88 :9
3348 |
3449LL | _ => {},
3550 | ^
3651
3752error: unreachable pattern
38- --> $DIR/empty-match.rs:60 :9
53+ --> $DIR/empty-match.rs:91 :9
3954 |
4055LL | _ if false => {},
4156 | ^
4257
4358error[E0004]: non-exhaustive patterns: type `u8` is non-empty
44- --> $DIR/empty-match.rs:78 :20
59+ --> $DIR/empty-match.rs:109 :20
4560 |
4661LL | match_no_arms!(0u8);
4762 | ^^^
@@ -50,69 +65,69 @@ LL | match_no_arms!(0u8);
5065 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
5166
5267error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty
53- --> $DIR/empty-match.rs:79 :20
68+ --> $DIR/empty-match.rs:111 :20
5469 |
5570LL | match_no_arms!(NonEmptyStruct1);
5671 | ^^^^^^^^^^^^^^^
5772 |
5873note: `NonEmptyStruct1` defined here
59- --> $DIR/empty-match.rs:14 :8
74+ --> $DIR/empty-match.rs:15 :8
6075 |
6176LL | struct NonEmptyStruct1;
6277 | ^^^^^^^^^^^^^^^
6378 = note: the matched value is of type `NonEmptyStruct1`
6479 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
6580
6681error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty
67- --> $DIR/empty-match.rs:80 :20
82+ --> $DIR/empty-match.rs:113 :20
6883 |
6984LL | match_no_arms!(NonEmptyStruct2(true));
7085 | ^^^^^^^^^^^^^^^^^^^^^
7186 |
7287note: `NonEmptyStruct2` defined here
73- --> $DIR/empty-match.rs:15 :8
88+ --> $DIR/empty-match.rs:18 :8
7489 |
7590LL | struct NonEmptyStruct2(bool);
7691 | ^^^^^^^^^^^^^^^
7792 = note: the matched value is of type `NonEmptyStruct2`
7893 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
7994
8095error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty
81- --> $DIR/empty-match.rs:81 :20
96+ --> $DIR/empty-match.rs:115 :20
8297 |
8398LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
8499 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85100 |
86101note: `NonEmptyUnion1` defined here
87- --> $DIR/empty-match.rs:16 :7
102+ --> $DIR/empty-match.rs:21 :7
88103 |
89104LL | union NonEmptyUnion1 {
90105 | ^^^^^^^^^^^^^^
91106 = note: the matched value is of type `NonEmptyUnion1`
92107 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
93108
94109error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty
95- --> $DIR/empty-match.rs:82 :20
110+ --> $DIR/empty-match.rs:117 :20
96111 |
97112LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
98113 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99114 |
100115note: `NonEmptyUnion2` defined here
101- --> $DIR/empty-match.rs:19 :7
116+ --> $DIR/empty-match.rs:26 :7
102117 |
103118LL | union NonEmptyUnion2 {
104119 | ^^^^^^^^^^^^^^
105120 = note: the matched value is of type `NonEmptyUnion2`
106121 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
107122
108123error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
109- --> $DIR/empty-match.rs:83 :20
124+ --> $DIR/empty-match.rs:119 :20
110125 |
111126LL | match_no_arms!(NonEmptyEnum1::Foo(true));
112127 | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
113128 |
114129note: `NonEmptyEnum1` defined here
115- --> $DIR/empty-match.rs:24 :5
130+ --> $DIR/empty-match.rs:33 :5
116131 |
117132LL | enum NonEmptyEnum1 {
118133 | -------------
@@ -122,39 +137,40 @@ LL | Foo(bool),
122137 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern
123138
124139error[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
126141 |
127142LL | match_no_arms!(NonEmptyEnum2::Foo(true));
128143 | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
129144 |
130145note: `NonEmptyEnum2` defined here
131- --> $DIR/empty-match.rs:27 :5
146+ --> $DIR/empty-match.rs:40 :5
132147 |
133148LL | enum NonEmptyEnum2 {
134149 | -------------
135150LL | Foo(bool),
136151 | ^^^ not covered
152+ ...
137153LL | Bar,
138154 | ^^^ not covered
139155 = note: the matched value is of type `NonEmptyEnum2`
140156 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
141157
142158error[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
144160 |
145161LL | match_no_arms!(NonEmptyEnum5::V1);
146162 | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
147163 |
148164note: `NonEmptyEnum5` defined here
149- --> $DIR/empty-match.rs:30 :6
165+ --> $DIR/empty-match.rs:49 :6
150166 |
151167LL | enum NonEmptyEnum5 {
152168 | ^^^^^^^^^^^^^
153169 = note: the matched value is of type `NonEmptyEnum5`
154170 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
155171
156172error[E0004]: non-exhaustive patterns: `_` not covered
157- --> $DIR/empty-match.rs:87 :24
173+ --> $DIR/empty-match.rs:129 :24
158174 |
159175LL | match_guarded_arm!(0u8);
160176 | ^^^ pattern `_` not covered
@@ -167,13 +183,13 @@ LL + _ => todo!()
167183 |
168184
169185error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
170- --> $DIR/empty-match.rs:88 :24
186+ --> $DIR/empty-match.rs:133 :24
171187 |
172188LL | match_guarded_arm!(NonEmptyStruct1);
173189 | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
174190 |
175191note: `NonEmptyStruct1` defined here
176- --> $DIR/empty-match.rs:14 :8
192+ --> $DIR/empty-match.rs:15 :8
177193 |
178194LL | struct NonEmptyStruct1;
179195 | ^^^^^^^^^^^^^^^
@@ -185,13 +201,13 @@ LL + NonEmptyStruct1 => todo!()
185201 |
186202
187203error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
188- --> $DIR/empty-match.rs:89 :24
204+ --> $DIR/empty-match.rs:137 :24
189205 |
190206LL | match_guarded_arm!(NonEmptyStruct2(true));
191207 | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
192208 |
193209note: `NonEmptyStruct2` defined here
194- --> $DIR/empty-match.rs:15 :8
210+ --> $DIR/empty-match.rs:18 :8
195211 |
196212LL | struct NonEmptyStruct2(bool);
197213 | ^^^^^^^^^^^^^^^
@@ -203,13 +219,13 @@ LL + NonEmptyStruct2(_) => todo!()
203219 |
204220
205221error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
206- --> $DIR/empty-match.rs:90 :24
222+ --> $DIR/empty-match.rs:141 :24
207223 |
208224LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
209225 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
210226 |
211227note: `NonEmptyUnion1` defined here
212- --> $DIR/empty-match.rs:16 :7
228+ --> $DIR/empty-match.rs:21 :7
213229 |
214230LL | union NonEmptyUnion1 {
215231 | ^^^^^^^^^^^^^^
@@ -221,13 +237,13 @@ LL + NonEmptyUnion1 { .. } => todo!()
221237 |
222238
223239error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
224- --> $DIR/empty-match.rs:91 :24
240+ --> $DIR/empty-match.rs:145 :24
225241 |
226242LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
227243 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
228244 |
229245note: `NonEmptyUnion2` defined here
230- --> $DIR/empty-match.rs:19 :7
246+ --> $DIR/empty-match.rs:26 :7
231247 |
232248LL | union NonEmptyUnion2 {
233249 | ^^^^^^^^^^^^^^
@@ -239,13 +255,13 @@ LL + NonEmptyUnion2 { .. } => todo!()
239255 |
240256
241257error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
242- --> $DIR/empty-match.rs:92 :24
258+ --> $DIR/empty-match.rs:149 :24
243259 |
244260LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
245261 | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
246262 |
247263note: `NonEmptyEnum1` defined here
248- --> $DIR/empty-match.rs:24 :5
264+ --> $DIR/empty-match.rs:33 :5
249265 |
250266LL | enum NonEmptyEnum1 {
251267 | -------------
@@ -259,18 +275,19 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
259275 |
260276
261277error[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
263279 |
264280LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
265281 | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
266282 |
267283note: `NonEmptyEnum2` defined here
268- --> $DIR/empty-match.rs:27 :5
284+ --> $DIR/empty-match.rs:40 :5
269285 |
270286LL | enum NonEmptyEnum2 {
271287 | -------------
272288LL | Foo(bool),
273289 | ^^^ not covered
290+ ...
274291LL | Bar,
275292 | ^^^ not covered
276293 = note: the matched value is of type `NonEmptyEnum2`
@@ -281,13 +298,13 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
281298 |
282299
283300error[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
285302 |
286303LL | match_guarded_arm!(NonEmptyEnum5::V1);
287304 | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
288305 |
289306note: `NonEmptyEnum5` defined here
290- --> $DIR/empty-match.rs:30 :6
307+ --> $DIR/empty-match.rs:49 :6
291308 |
292309LL | enum NonEmptyEnum5 {
293310 | ^^^^^^^^^^^^^
@@ -298,6 +315,7 @@ LL ~ _ if false => {},
298315LL + _ => todo!()
299316 |
300317
301- error: aborting due to 22 previous errors
318+ error: aborting due to 23 previous errors
302319
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