Don't give invalid suggestions in array_into_iter.

This commit is contained in:
Mara Bos 2021-08-30 23:42:13 +02:00
parent 422ad3bec2
commit 90080f4703

View file

@ -141,7 +141,7 @@ impl<'tcx> LateLintPass<'tcx> for ArrayIntoIter {
String::new(),
Applicability::MaybeIncorrect,
);
} else {
} else if receiver_ty.is_array() {
diag.multipart_suggestion(
"or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value",
vec![