-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Add nuance to suggestion of !Copy expressions in for loops #82916
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-iteratorsArea: IteratorsArea: IteratorsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`P-lowLow priorityLow priorityT-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 lintsA-iteratorsArea: IteratorsArea: IteratorsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`P-lowLow priorityLow priorityT-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.
Given
we currently suggest borrowing
x:The
notedoesn't have a span, so we should remove it when it isDUMMY_SP.When we make the
ypatternmut, we get the same output.We should likely suggest
.iter_mut()when the pattern is mutable, and the expression isn'tCopy.