]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/array.stderr
Auto merge of #62339 - pnkfelix:issue-61188-use-visitor-for-structural-match-check...
[rust.git] / src / test / ui / iterators / array.stderr
1 error[E0277]: `[{integer}; 2]` is not an iterator
2   --> $DIR/array.rs:2:14
3    |
4 LL |     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
11 error[E0277]: `[{integer}; 2]` is not an iterator
12   --> $DIR/array.rs:5:14
13    |
14 LL |     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
21 error[E0277]: `[{float}; 2]` is not an iterator
22   --> $DIR/array.rs:7:14
23    |
24 LL |     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
31 error: aborting due to 3 previous errors
32
33 For more information about this error, try `rustc --explain E0277`.