]> git.lizzy.rs Git - rust.git/blob - src/test/ui/empty/empty-never-array.stderr
Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
[rust.git] / src / test / ui / empty / empty-never-array.stderr
1 error[E0005]: refutable pattern in local binding: `Helper::T(_, _)` not covered
2   --> $DIR/empty-never-array.rs:10:9
3    |
4 LL |     let Helper::U(u) = Helper::T(t, []);
5    |         ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered
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
9 note: `Helper<T, U>` defined here
10   --> $DIR/empty-never-array.rs:4:5
11    |
12 LL | enum Helper<T, U> {
13    |      ------
14 LL |     T(T, [!; 0]),
15    |     ^ not covered
16    = note: the matched value is of type `Helper<T, U>`
17 help: you might want to use `if let` to ignore the variant that isn't matched
18    |
19 LL |     let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() };
20    |     ++++++++++                                     ++++++++++++++++++++++
21 help: alternatively, you might want to use let else to handle the variant that isn't matched
22    |
23 LL |     let Helper::U(u) = Helper::T(t, []) else { todo!() };
24    |                                         ++++++++++++++++
25
26 error: aborting due to previous error
27
28 For more information about this error, try `rustc --explain E0005`.