about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-08-30 23:42:13 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-08-30 23:43:38 +0200
commit90080f47032b5b2d578b0940ee615a428680e884 (patch)
tree91c6fd44c6e01d56dd2068e824e7434234a0e38a
parent422ad3bec2a9b41345cf1dd95a4ce4b4d9f159d8 (diff)
downloadrust-90080f47032b5b2d578b0940ee615a428680e884.tar.gz
rust-90080f47032b5b2d578b0940ee615a428680e884.zip
Don't give invalid suggestions in array_into_iter.
-rw-r--r--compiler/rustc_lint/src/array_into_iter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/array_into_iter.rs b/compiler/rustc_lint/src/array_into_iter.rs
index 2e20f376766..5ac42c50c72 100644
--- a/compiler/rustc_lint/src/array_into_iter.rs
+++ b/compiler/rustc_lint/src/array_into_iter.rs
@@ -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![