mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Add new suggestion to array_into_iter lint.
This commit is contained in:
parent
37e17803b5
commit
5cfe2a5fc6
@ -110,6 +110,14 @@ impl<'tcx> LateLintPass<'tcx> for ArrayIntoIter {
|
||||
"iter".into(),
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.multipart_suggestion(
|
||||
"or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value",
|
||||
vec![
|
||||
(expr.span.shrink_to_lo(), "IntoIterator::into_iter(".into()),
|
||||
(receiver_arg.span.shrink_to_hi().to(expr.span.shrink_to_hi()), ")".into()),
|
||||
],
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
.emit();
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user