1719337d02
This reverts commit 8f6197f39f
.
26 lines
896 B
Plaintext
26 lines
896 B
Plaintext
error[E0005]: refutable pattern in local binding: `A(_)` not covered
|
|
--> $DIR/uninhabited-irrefutable.rs:27:9
|
|
|
|
|
LL | / enum Foo {
|
|
LL | | A(foo::SecretlyEmpty),
|
|
| | - not covered
|
|
LL | | B(foo::NotSoSecretlyEmpty),
|
|
LL | | C(NotSoSecretlyEmpty),
|
|
LL | | D(u32),
|
|
LL | | }
|
|
| |_- `Foo` defined here
|
|
...
|
|
LL | let Foo::D(_y) = x;
|
|
| ^^^^^^^^^^ pattern `A(_)` not covered
|
|
|
|
|
= note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
|
|
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
|
|
help: you might want to use `if let` to ignore the variant that isn't matched
|
|
|
|
|
LL | if let Foo::D(_y) = x { /* */ }
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0005`.
|