about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-05-25 17:56:19 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-06-26 12:14:22 +0000
commitaec2c5b2b61a5c69742e5e408aa5e64477be6eb3 (patch)
treec5a181bcdc31e5334230c52303270b591a9acb31
parent5cfe2a5fc621092ef4a14c22e2855fa07b690cac (diff)
downloadrust-aec2c5b2b61a5c69742e5e408aa5e64477be6eb3.tar.gz
rust-aec2c5b2b61a5c69742e5e408aa5e64477be6eb3.zip
Update tests for updated array_into_iter lint.
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-2018.rs4
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-2018.stderr24
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-lint.fixed24
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-lint.rs24
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-lint.stderr144
5 files changed, 166 insertions, 54 deletions
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.rs b/src/test/ui/iterators/into-iter-on-arrays-2018.rs
index 546052817d2..255ebfbd8f9 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-2018.rs
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.rs
@@ -12,11 +12,11 @@ fn main() {
     // Before 2021, the method dispatched to `IntoIterator for &[T; N]`,
     // which we continue to support for compatibility.
     let _: Iter<'_, i32> = array.into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     let _: Iter<'_, i32> = Box::new(array).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     // The `array_into_iter` lint doesn't cover other wrappers that deref to an array.
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
index 82596c6f022..b6ca4ba2283 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
@@ -1,21 +1,37 @@
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-2018.rs:14:34
    |
 LL |     let _: Iter<'_, i32> = array.into_iter();
-   |                                  ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                                  ^^^^^^^^^
    |
    = note: `#[warn(array_into_iter)]` on by default
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     let _: Iter<'_, i32> = array.iter();
+   |                                  ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     let _: Iter<'_, i32> = IntoIterator::into_iter(array);
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^^     ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-2018.rs:18:44
    |
 LL |     let _: Iter<'_, i32> = Box::new(array).into_iter();
-   |                                            ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                                            ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     let _: Iter<'_, i32> = Box::new(array).iter();
+   |                                            ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     let _: Iter<'_, i32> = IntoIterator::into_iter(Box::new(array));
+   |                            ^^^^^^^^^^^^^^^^^^^^^^^^               ^
 
 warning: 2 warnings emitted
 
diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.fixed b/src/test/ui/iterators/into-iter-on-arrays-lint.fixed
index ede96d7cea1..f206134d83f 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-lint.fixed
+++ b/src/test/ui/iterators/into-iter-on-arrays-lint.fixed
@@ -7,42 +7,42 @@ fn main() {
 
     // Expressions that should trigger the lint
     small.iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     [1, 2].iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     big.iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     [0u8; 33].iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     Box::new(small).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new([1, 2]).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(big).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new([0u8; 33]).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     Box::new(Box::new(small)).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new([1, 2])).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new(big)).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new([0u8; 33])).iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     // Expressions that should not
diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.rs b/src/test/ui/iterators/into-iter-on-arrays-lint.rs
index 3a0cb75ed15..a43a7ea797f 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-lint.rs
+++ b/src/test/ui/iterators/into-iter-on-arrays-lint.rs
@@ -7,42 +7,42 @@ fn main() {
 
     // Expressions that should trigger the lint
     small.into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     [1, 2].into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     big.into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     [0u8; 33].into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     Box::new(small).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new([1, 2]).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(big).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new([0u8; 33]).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     Box::new(Box::new(small)).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new([1, 2])).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new(big)).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
     Box::new(Box::new([0u8; 33])).into_iter();
-    //~^ WARNING this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter`
+    //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
     //~| WARNING this changes meaning
 
     // Expressions that should not
diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
index 1f33a5c659b..fb34384b4e5 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
@@ -1,111 +1,207 @@
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:9:11
    |
 LL |     small.into_iter();
-   |           ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |           ^^^^^^^^^
    |
    = note: `#[warn(array_into_iter)]` on by default
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     small.iter();
+   |           ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(small);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^     ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:12:12
    |
 LL |     [1, 2].into_iter();
-   |            ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |            ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     [1, 2].iter();
+   |            ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter([1, 2]);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^      ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:15:9
    |
 LL |     big.into_iter();
-   |         ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |         ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     big.iter();
+   |         ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(big);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^   ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:18:15
    |
 LL |     [0u8; 33].into_iter();
-   |               ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |               ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     [0u8; 33].iter();
+   |               ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter([0u8; 33]);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^         ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:22:21
    |
 LL |     Box::new(small).into_iter();
-   |                     ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                     ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(small).iter();
+   |                     ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(small));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^               ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:25:22
    |
 LL |     Box::new([1, 2]).into_iter();
-   |                      ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                      ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new([1, 2]).iter();
+   |                      ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new([1, 2]));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:28:19
    |
 LL |     Box::new(big).into_iter();
-   |                   ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                   ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(big).iter();
+   |                   ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(big));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^             ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:31:25
    |
 LL |     Box::new([0u8; 33]).into_iter();
-   |                         ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                         ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new([0u8; 33]).iter();
+   |                         ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new([0u8; 33]));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                   ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:35:31
    |
 LL |     Box::new(Box::new(small)).into_iter();
-   |                               ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                               ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(Box::new(small)).iter();
+   |                               ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(Box::new(small)));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                         ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:38:32
    |
 LL |     Box::new(Box::new([1, 2])).into_iter();
-   |                                ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                                ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(Box::new([1, 2])).iter();
+   |                                ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(Box::new([1, 2])));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                          ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:41:29
    |
 LL |     Box::new(Box::new(big)).into_iter();
-   |                             ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                             ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(Box::new(big)).iter();
+   |                             ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(Box::new(big)));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                       ^
 
-warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
   --> $DIR/into-iter-on-arrays-lint.rs:44:35
    |
 LL |     Box::new(Box::new([0u8; 33])).into_iter();
-   |                                   ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+   |                                   ^^^^^^^^^
    |
    = warning: this changes meaning in Rust 2021
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+   |
+LL |     Box::new(Box::new([0u8; 33])).iter();
+   |                                   ^^^^
+help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
+   |
+LL |     IntoIterator::into_iter(Box::new(Box::new([0u8; 33])));
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^                             ^
 
 warning: 12 warnings emitted