rust/src/test/ui/uninhabited/uninhabited-irrefutable.stderr

26 lines
896 B
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0005]: refutable pattern in local binding: `A(_)` not covered
--> $DIR/uninhabited-irrefutable.rs:26:9
2018-08-08 07:28:26 -05:00
|
LL | / enum Foo {
LL | | A(foo::SecretlyEmpty),
| | - not covered
LL | | B(foo::NotSoSecretlyEmpty),
LL | | C(NotSoSecretlyEmpty),
LL | | D(u32),
LL | | }
| |_- `Foo` defined here
...
2019-03-09 06:03:44 -06:00
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 { /* */ }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2018-08-08 07:28:26 -05:00
error: aborting due to previous error
For more information about this error, try `rustc --explain E0005`.