blob: e1ff38f3057f142e2052511b5fe47253edd7d99c [file] [log] [blame]
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
= note: the matched value is of type `Foo`
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`.