]> git.lizzy.rs Git - rust.git/blob - src/test/ui/uninhabited/uninhabited-irrefutable.stderr
Rollup merge of #88601 - ibraheemdev:termination-result-infallible, r=yaahc
[rust.git] / src / test / ui / uninhabited / uninhabited-irrefutable.stderr
1 error[E0005]: refutable pattern in local binding: `A(_)` not covered
2   --> $DIR/uninhabited-irrefutable.rs:27:9
3    |
4 LL | / enum Foo {
5 LL | |     A(foo::SecretlyEmpty),
6    | |     - not covered
7 LL | |     B(foo::NotSoSecretlyEmpty),
8 LL | |     C(NotSoSecretlyEmpty),
9 LL | |     D(u32),
10 LL | | }
11    | |_- `Foo` defined here
12 ...
13 LL |       let Foo::D(_y) = x;
14    |           ^^^^^^^^^^ pattern `A(_)` not covered
15    |
16    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
17    = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
18    = note: the matched value is of type `Foo`
19 help: you might want to use `if let` to ignore the variant that isn't matched
20    |
21 LL |     if let Foo::D(_y) = x { /* */ }
22    |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0005`.