]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/array-of-ranges.stderr
Auto merge of #62339 - pnkfelix:issue-61188-use-visitor-for-structural-match-check...
[rust.git] / src / test / ui / iterators / array-of-ranges.stderr
1 error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
2   --> $DIR/array-of-ranges.rs:2:14
3    |
4 LL |     for _ in [0..1] {}
5    |              ^^^^^^ if you meant to iterate between two values, remove the square brackets
6    |
7    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 1]`
8    = note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end`
9    = note: required by `std::iter::IntoIterator::into_iter`
10
11 error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
12   --> $DIR/array-of-ranges.rs:4:14
13    |
14 LL |     for _ in [0..=1] {}
15    |              ^^^^^^^ if you meant to iterate between two values, remove the square brackets
16    |
17    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::RangeInclusive<{integer}>; 1]`
18    = note: `[start..=end]` is an array of one `RangeInclusive`; you might have meant to have a `RangeInclusive` without the brackets: `start..=end`
19    = note: required by `std::iter::IntoIterator::into_iter`
20
21 error[E0277]: `[std::ops::RangeFrom<{integer}>; 1]` is not an iterator
22   --> $DIR/array-of-ranges.rs:6:14
23    |
24 LL |     for _ in [0..] {}
25    |              ^^^^^ if you meant to iterate from a value onwards, remove the square brackets
26    |
27    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::RangeFrom<{integer}>; 1]`
28    = note: `[start..]` is an array of one `RangeFrom`; you might have meant to have a `RangeFrom` without the brackets: `start..`, keeping in mind that iterating over an unbounded iterator will run forever unless you `break` or `return` from within the loop
29    = note: required by `std::iter::IntoIterator::into_iter`
30
31 error[E0277]: `[std::ops::RangeTo<{integer}>; 1]` is not an iterator
32   --> $DIR/array-of-ranges.rs:8:14
33    |
34 LL |     for _ in [..1] {}
35    |              ^^^^^ if you meant to iterate until a value, remove the square brackets and add a starting value
36    |
37    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::RangeTo<{integer}>; 1]`
38    = note: `[..end]` is an array of one `RangeTo`; you might have meant to have a bounded `Range` without the brackets: `0..end`
39    = note: required by `std::iter::IntoIterator::into_iter`
40
41 error[E0277]: `[std::ops::RangeToInclusive<{integer}>; 1]` is not an iterator
42   --> $DIR/array-of-ranges.rs:10:14
43    |
44 LL |     for _ in [..=1] {}
45    |              ^^^^^^ if you meant to iterate until a value (including it), remove the square brackets and add a starting value
46    |
47    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::RangeToInclusive<{integer}>; 1]`
48    = note: `[..=end]` is an array of one `RangeToInclusive`; you might have meant to have a bounded `RangeInclusive` without the brackets: `0..=end`
49    = note: required by `std::iter::IntoIterator::into_iter`
50
51 error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
52   --> $DIR/array-of-ranges.rs:14:14
53    |
54 LL |     for _ in [start..end] {}
55    |              ^^^^^^^^^^^^ if you meant to iterate between two values, remove the square brackets
56    |
57    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 1]`
58    = note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end`
59    = note: required by `std::iter::IntoIterator::into_iter`
60
61 error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
62   --> $DIR/array-of-ranges.rs:17:14
63    |
64 LL |     for _ in array_of_range {}
65    |              ^^^^^^^^^^^^^^ if you meant to iterate between two values, remove the square brackets
66    |
67    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 1]`
68    = note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end`
69    = note: required by `std::iter::IntoIterator::into_iter`
70
71 error[E0277]: `[std::ops::Range<{integer}>; 2]` is not an iterator
72   --> $DIR/array-of-ranges.rs:19:14
73    |
74 LL |     for _ in [0..1, 2..3] {}
75    |              ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
76    |
77    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 2]`
78    = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
79    = note: required by `std::iter::IntoIterator::into_iter`
80
81 error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
82   --> $DIR/array-of-ranges.rs:21:14
83    |
84 LL |     for _ in [0..=1] {}
85    |              ^^^^^^^ if you meant to iterate between two values, remove the square brackets
86    |
87    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::RangeInclusive<{integer}>; 1]`
88    = note: `[start..=end]` is an array of one `RangeInclusive`; you might have meant to have a `RangeInclusive` without the brackets: `start..=end`
89    = note: required by `std::iter::IntoIterator::into_iter`
90
91 error: aborting due to 9 previous errors
92
93 For more information about this error, try `rustc --explain E0277`.