]>
Commit | Line | Data |
---|---|---|
487cf647 FG |
1 | error[E0005]: refutable pattern in local binding: `Either::B(_)` not covered |
2 | --> $DIR/exhaustive_patterns.rs:20:9 | |
3 | | | |
4 | LL | let Either::A(()) = foo(); | |
5 | | ^^^^^^^^^^^^^ pattern `Either::B(_)` 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: `Either<(), !>` defined here | |
10 | --> $DIR/exhaustive_patterns.rs:12:5 | |
11 | | | |
12 | LL | enum Either<A, B> { | |
13 | | ------ | |
14 | LL | A(A), | |
15 | LL | B(inner::Wrapper<B>), | |
16 | | ^ not covered | |
17 | = note: the matched value is of type `Either<(), !>` | |
18 | help: you might want to use `if let` to ignore the variant that isn't matched | |
19 | | | |
20 | LL | if let Either::A(()) = foo() { todo!() } | |
21 | | ++ ~~~~~~~~~~~ | |
22 | ||
23 | error: aborting due to previous error | |
24 | ||
25 | For more information about this error, try `rustc --explain E0005`. |