@@ -28,20 +28,35 @@ error: unreachable pattern
2828LL | _ if false => {},
2929 | ^
3030
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+
3146error: unreachable pattern
32- --> $DIR/empty-match.rs:57 :9
47+ --> $DIR/empty-match.rs:61 :9
3348 |
3449LL | _ => {},
3550 | ^
3651
3752error: unreachable pattern
38- --> $DIR/empty-match.rs:60 :9
53+ --> $DIR/empty-match.rs:64 :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:82 :20
4560 |
4661LL | match_no_arms!(0u8);
4762 | ^^^
@@ -50,7 +65,7 @@ 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:83 :20
5469 |
5570LL | match_no_arms!(NonEmptyStruct1);
5671 | ^^^^^^^^^^^^^^^
@@ -64,7 +79,7 @@ LL | struct 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:84 :20
6883 |
6984LL | match_no_arms!(NonEmptyStruct2(true));
7085 | ^^^^^^^^^^^^^^^^^^^^^
@@ -78,7 +93,7 @@ LL | struct NonEmptyStruct2(bool);
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:85 :20
8297 |
8398LL | match_no_arms!((NonEmptyUnion1 { foo: () }));
8499 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,7 +107,7 @@ LL | union 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:86 :20
96111 |
97112LL | match_no_arms!((NonEmptyUnion2 { foo: () }));
98113 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,7 +121,7 @@ LL | union 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:87 :20
110125 |
111126LL | match_no_arms!(NonEmptyEnum1::Foo(true));
112127 | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -122,7 +137,7 @@ 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:88 :20
126141 |
127142LL | match_no_arms!(NonEmptyEnum2::Foo(true));
128143 | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -140,7 +155,7 @@ LL | Bar,
140155 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
141156
142157error[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
144159 |
145160LL | match_no_arms!(NonEmptyEnum5::V1);
146161 | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -154,7 +169,7 @@ LL | enum NonEmptyEnum5 {
154169 = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms
155170
156171error[E0004]: non-exhaustive patterns: `_` not covered
157- --> $DIR/empty-match.rs:87 :24
172+ --> $DIR/empty-match.rs:91 :24
158173 |
159174LL | match_guarded_arm!(0u8);
160175 | ^^^ pattern `_` not covered
@@ -167,7 +182,7 @@ LL + _ => todo!()
167182 |
168183
169184error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered
170- --> $DIR/empty-match.rs:88 :24
185+ --> $DIR/empty-match.rs:92 :24
171186 |
172187LL | match_guarded_arm!(NonEmptyStruct1);
173188 | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered
@@ -185,7 +200,7 @@ LL + NonEmptyStruct1 => todo!()
185200 |
186201
187202error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered
188- --> $DIR/empty-match.rs:89 :24
203+ --> $DIR/empty-match.rs:93 :24
189204 |
190205LL | match_guarded_arm!(NonEmptyStruct2(true));
191206 | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered
@@ -203,7 +218,7 @@ LL + NonEmptyStruct2(_) => todo!()
203218 |
204219
205220error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered
206- --> $DIR/empty-match.rs:90 :24
221+ --> $DIR/empty-match.rs:94 :24
207222 |
208223LL | match_guarded_arm!((NonEmptyUnion1 { foo: () }));
209224 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered
@@ -221,7 +236,7 @@ LL + NonEmptyUnion1 { .. } => todo!()
221236 |
222237
223238error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered
224- --> $DIR/empty-match.rs:91 :24
239+ --> $DIR/empty-match.rs:95 :24
225240 |
226241LL | match_guarded_arm!((NonEmptyUnion2 { foo: () }));
227242 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered
@@ -239,7 +254,7 @@ LL + NonEmptyUnion2 { .. } => todo!()
239254 |
240255
241256error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
242- --> $DIR/empty-match.rs:92 :24
257+ --> $DIR/empty-match.rs:96 :24
243258 |
244259LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
245260 | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
@@ -259,7 +274,7 @@ LL + NonEmptyEnum1::Foo(_) => todo!()
259274 |
260275
261276error[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
263278 |
264279LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
265280 | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
@@ -281,7 +296,7 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
281296 |
282297
283298error[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
285300 |
286301LL | match_guarded_arm!(NonEmptyEnum5::V1);
287302 | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
@@ -298,6 +313,7 @@ LL ~ _ if false => {},
298313LL + _ => todo!()
299314 |
300315
301- error: aborting due to 22 previous errors
316+ error: aborting due to 23 previous errors
302317
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