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 50236d8 commit 1e89954Copy full SHA for 1e89954
compiler/rustc_lint/src/array_into_iter.rs
@@ -104,6 +104,14 @@ impl<'tcx> LateLintPass<'tcx> for ArrayIntoIter {
104
"iter".into(),
105
Applicability::MachineApplicable,
106
)
107
+ .multipart_suggestion(
108
+ "or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value",
109
+ vec![
110
+ (expr.span.shrink_to_lo(), "IntoIterator::into_iter(".into()),
111
+ (receiver_arg.span.shrink_to_hi().to(expr.span.shrink_to_hi()), ")".into()),
112
+ ],
113
+ Applicability::MaybeIncorrect,
114
+ )
115
.emit();
116
})
117
}
0 commit comments