]> git.proxmox.com Git - rustc.git/blame - src/test/ui/uninhabited/uninhabited-irrefutable.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / uninhabited / uninhabited-irrefutable.stderr
CommitLineData
f2b60f7d 1error[E0005]: refutable pattern in local binding: `Foo::A(_)` not covered
0731742a 2 --> $DIR/uninhabited-irrefutable.rs:27:9
b7449926 3 |
5e7ed085 4LL | let Foo::D(_y, _z) = x;
f2b60f7d 5 | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered
e74abb32
XL
6 |
7 = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
8 = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
5e7ed085
FG
9note: `Foo` defined here
10 --> $DIR/uninhabited-irrefutable.rs:19:5
11 |
12LL | enum Foo {
13 | ---
14LL | A(foo::SecretlyEmpty),
15 | ^ not covered
ba9703b0 16 = note: the matched value is of type `Foo`
e74abb32
XL
17help: you might want to use `if let` to ignore the variant that isn't matched
18 |
5e7ed085
FG
19LL | let (_y, _z) = if let Foo::D(_y, _z) = x { (_y, _z) } else { todo!() };
20 | +++++++++++++++++ +++++++++++++++++++++++++++++
f2b60f7d 21help: alternatively, you might want to use let else to handle the variant that isn't matched
5e7ed085
FG
22 |
23LL | let Foo::D(_y, _z) = x else { todo!() };
24 | ++++++++++++++++
b7449926
XL
25
26error: aborting due to previous error
27
28For more information about this error, try `rustc --explain E0005`.