summaryrefslogtreecommitdiffstats
path: root/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/iterators/into-iter-on-arrays-2018.stderr')
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-2018.stderr65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
new file mode 100644
index 000000000..9b3125058
--- /dev/null
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
@@ -0,0 +1,65 @@
+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();
+ | ^^^^^^^^^
+ |
+ = note: `#[warn(array_into_iter)]` on by default
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+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 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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+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:22:43
+ |
+LL | let _: Iter<'_, i32> = Rc::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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+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:25:41
+ |
+LL | let _: Iter<'_, i32> = Array(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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+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:32:24
+ |
+LL | for _ in [1, 2, 3].into_iter() {}
+ | ^^^^^^^^^
+ |
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
+ |
+LL | for _ in [1, 2, 3].iter() {}
+ | ~~~~
+help: or remove `.into_iter()` to iterate by value
+ |
+LL - for _ in [1, 2, 3].into_iter() {}
+LL + for _ in [1, 2, 3] {}
+ |
+
+warning: 5 warnings emitted
+