fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
942 B26 linesraw
1error[E0005]: refutable pattern in local binding: `A(_)` not covered
2  --> $DIR/uninhabited-irrefutable.rs:27:9
3   |
4LL | / enum Foo {
5LL | |     A(foo::SecretlyEmpty),
6   | |     - not covered
7LL | |     B(foo::NotSoSecretlyEmpty),
8LL | |     C(NotSoSecretlyEmpty),
9LL | |     D(u32),
10LL | | }
11   | |_- `Foo` defined here
12...
13LL |       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`
19help: you might want to use `if let` to ignore the variant that isn't matched
20   |
21LL |     if let Foo::D(_y) = x { /* */ }
22   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
24error: aborting due to previous error
25
26For more information about this error, try `rustc --explain E0005`.