-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-exhaustiveness-checkingRelating to exhaustiveness / usefulness checking of patternsRelating to exhaustiveness / usefulness checking of patternsC-bugCategory: This is a bug.Category: This is a bug.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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.
Metadata
Metadata
Assignees
Labels
A-exhaustiveness-checkingRelating to exhaustiveness / usefulness checking of patternsRelating to exhaustiveness / usefulness checking of patternsC-bugCategory: This is a bug.Category: This is a bug.F-or_patterns`#![feature(or_patterns)]``#![feature(or_patterns)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.