1 error[E0005]: refutable pattern in local binding
2 --> $DIR/exhaustive_patterns.rs:20:9
4 LL | let Either::A(()) = foo();
5 | ^^^^^^^^^^^^^ pattern `Either::B(_)` not covered
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:10:6
12 LL | enum Either<A, B> {
15 LL | B(inner::Wrapper<B>),
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
20 LL | if let Either::A(()) = foo() { todo!() }
23 error: aborting due to previous error
25 For more information about this error, try `rustc --explain E0005`.