diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-08-30 23:42:13 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-08-30 23:43:38 +0200 |
| commit | 90080f47032b5b2d578b0940ee615a428680e884 (patch) | |
| tree | 91c6fd44c6e01d56dd2068e824e7434234a0e38a | |
| parent | 422ad3bec2a9b41345cf1dd95a4ce4b4d9f159d8 (diff) | |
| download | rust-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.rs | 2 |
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