Closed
Description
#![feature(or_patterns)]
enum F {
A,
B,
}
fn main() {
let a = F::A;
let b = F::B;
match (a, b) {
(F::A, F::A) => (),
(F::B | F::A, F::B | F::A) => (),
}
}
Results in the following incorrect warning:
warning: unreachable pattern
--> src/main.rs:13:30
|
13 | (F::B | F::A, F::B | F::A) => (),
| ^^^^
|
= note: `#[warn(unreachable_patterns)]` on by default
warning: 1 warning emitted
Removing F::A
causes a non-exhaustive patterns error as expected.