Add nuance to suggestion of !Copy expressions in for loops #82916
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-iterators
Area: Iterators
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
P-low
Low priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given
we currently suggest borrowing
x
:The
note
doesn't have a span, so we should remove it when it isDUMMY_SP
.When we make the
y
patternmut
, we get the same output.We should likely suggest
.iter_mut()
when the pattern is mutable, and the expression isn'tCopy
.The text was updated successfully, but these errors were encountered: