-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Suggest removing [] for array of 1 RangeBounds arguments. #147944
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.Diagnostics: Confusing error or lint; hard to understand for new users.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
Fields
Give feedbackNo fields configured for issues without a type.
Code
Current output
Desired output
Rationale and extra context
It's not obvious from the error message why trait bound wasn't satisfied. Rust compiler should probably highlight the fact that
[..3]is an array of 1 range, not a range.Second option may be to
impl RangeBounds<T> for [ impl RangeBounds<T> ; 1 ].Other cases
Rust Version
Anything else?
No response