]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/into-iter-on-arrays-2018.stderr
move an `assert!` to the right place
[rust.git] / src / test / ui / iterators / into-iter-on-arrays-2018.stderr
1 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
2   --> $DIR/into-iter-on-arrays-2018.rs:14:34
3    |
4 LL |     let _: Iter<'_, i32> = array.into_iter();
5    |                                  ^^^^^^^^^
6    |
7    = note: `#[warn(array_into_iter)]` on by default
8    = warning: this changes meaning in Rust 2021
9    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
10 help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
11    |
12 LL |     let _: Iter<'_, i32> = array.iter();
13    |                                  ~~~~
14 help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
15    |
16 LL |     let _: Iter<'_, i32> = IntoIterator::into_iter(array);
17    |                            ++++++++++++++++++++++++     ~
18
19 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
20   --> $DIR/into-iter-on-arrays-2018.rs:18:44
21    |
22 LL |     let _: Iter<'_, i32> = Box::new(array).into_iter();
23    |                                            ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
24    |
25    = warning: this changes meaning in Rust 2021
26    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
27
28 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
29   --> $DIR/into-iter-on-arrays-2018.rs:22:43
30    |
31 LL |     let _: Iter<'_, i32> = Rc::new(array).into_iter();
32    |                                           ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
33    |
34    = warning: this changes meaning in Rust 2021
35    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
36
37 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
38   --> $DIR/into-iter-on-arrays-2018.rs:25:41
39    |
40 LL |     let _: Iter<'_, i32> = Array(array).into_iter();
41    |                                         ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
42    |
43    = warning: this changes meaning in Rust 2021
44    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
45
46 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
47   --> $DIR/into-iter-on-arrays-2018.rs:32:24
48    |
49 LL |     for _ in [1, 2, 3].into_iter() {}
50    |                        ^^^^^^^^^
51    |
52    = warning: this changes meaning in Rust 2021
53    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
54 help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
55    |
56 LL |     for _ in [1, 2, 3].iter() {}
57    |                        ~~~~
58 help: or remove `.into_iter()` to iterate by value
59    |
60 LL -     for _ in [1, 2, 3].into_iter() {}
61 LL +     for _ in [1, 2, 3] {}
62    |
63
64 warning: 5 warnings emitted
65