-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Closed
Copy link
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.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.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
For a match where I'm matching on a u8
, I put 251..=256
on accident, and then rather than saying that 256 is out of range for u8
, it decided to wrap 256 to 0 and then error that 251 is lower than the end of the range:
error[E0030]: lower range bound must be less than or equal to upper
--> src\lib.rs:86:7
|
86 | 251..=256 => StarClass::BlueGiant,
| ^^^ lower bound larger than upper bound
Clearly this is not a good situation.
XiphoseerAaron1011, tesuji and LeSeulArtichaut
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.D-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.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.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
hirschenberger commentedon Feb 11, 2020
I'd like to fix this
@rustbot claim
JohnTitor commentedon Jul 24, 2020
Triage: I'm going to release assignment due to inactivity.
@hirschenberger If you're still interested in this, feel free to re-claim.
@rustbot release-assignment
estebank commentedon Feb 9, 2021
Explanation on how to solve this in #81903 (comment):
Detect out of bounds range pattern value
2 remaining items