We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37e1780 commit 5cfe2a5Copy full SHA for 5cfe2a5
compiler/rustc_lint/src/array_into_iter.rs
@@ -110,6 +110,14 @@ impl<'tcx> LateLintPass<'tcx> for ArrayIntoIter {
110
"iter".into(),
111
Applicability::MachineApplicable,
112
)
113
+ .multipart_suggestion(
114
+ "or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value",
115
+ vec![
116
+ (expr.span.shrink_to_lo(), "IntoIterator::into_iter(".into()),
117
+ (receiver_arg.span.shrink_to_hi().to(expr.span.shrink_to_hi()), ")".into()),
118
+ ],
119
+ Applicability::MaybeIncorrect,
120
+ )
121
.emit();
122
})
123
}
0 commit comments