-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.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.
Description
Code
match (0i8, 0i8) {
(0, _) => {}
// change either of these to not overlap and it will error
(..=-1, ..=0) => {}
(1.., 0..) => {}
(1.., ..=-1) | (..=-1, 1..) => {}
}
Current output
warning: multiple patterns overlap on their endpoints
--> src/main.rs:6:15
|
5 | (..=-1, ..=0) => {}
| ---- this range overlaps on `0_i8`...
6 | (1.., 0..) => {}
| ^^^ ... with this range
|
= note: you likely meant to write mutually exclusive ranges
= note: `#[warn(overlapping_range_endpoints)]` on by default
Desired output
no output, pattern is exhaustive. addressing the warning causes an error as it is no longer exhaustive.
Rationale and extra context
No response
Other cases
No response
Anything else?
this is only occurring on nightly (at least as of 2023-11-01, i haven't tested anything sooner)
scooter-dangle, discosultan, Rodrigodd, yerke, curiousdannii and 2 more
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-patternsRelating to patterns and pattern matchingRelating to patterns and pattern matchingC-bugCategory: This is a bug.Category: This is a bug.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.