fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.4 KiB33 linesraw
1error[E0277]: `[{integer}; 2]` is not an iterator
2  --> $DIR/array.rs:2:14
3   |
4LL |     for _ in [1, 2] {}
5   |              ^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
6   |
7   = help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
8   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
9   = note: required by `std::iter::IntoIterator::into_iter`
10
11error[E0277]: `[{integer}; 2]` is not an iterator
12  --> $DIR/array.rs:5:14
13   |
14LL |     for _ in x {}
15   |              ^ borrow the array with `&` or call `.iter()` on it to iterate over it
16   |
17   = help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
18   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
19   = note: required by `std::iter::IntoIterator::into_iter`
20
21error[E0277]: `[{float}; 2]` is not an iterator
22  --> $DIR/array.rs:7:14
23   |
24LL |     for _ in [1.0, 2.0] {}
25   |              ^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
26   |
27   = help: the trait `std::iter::Iterator` is not implemented for `[{float}; 2]`
28   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
29   = note: required by `std::iter::IntoIterator::into_iter`
30
31error: aborting due to 3 previous errors
32
33For more information about this error, try `rustc --explain E0277`.