You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/ui/iterators/array-of-ranges.stderr
+10-10
Original file line number
Diff line number
Diff line change
@@ -13,43 +13,43 @@ error[E0277]: `[RangeInclusive<{integer}>; 1]` is not an iterator
13
13
--> $DIR/array-of-ranges.rs:4:14
14
14
|
15
15
LL | for _ in [0..=1] {}
16
-
| ^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
16
+
| ^^^^^^^ if you meant to iterate between two values, remove the square brackets
17
17
|
18
18
= help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]`
19
-
= note: see <https://github.com/rust-lang/rust/pull/65819> for more details
19
+
= note: `[start..=end]` is an array of one `RangeInclusive`; you might have meant to have a `RangeInclusive` without the brackets: `start..=end`
20
20
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]`
21
21
= note: required by `into_iter`
22
22
23
23
error[E0277]: `[RangeFrom<{integer}>; 1]` is not an iterator
24
24
--> $DIR/array-of-ranges.rs:6:14
25
25
|
26
26
LL | for _ in [0..] {}
27
-
| ^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
27
+
| ^^^^^ if you meant to iterate from a value onwards, remove the square brackets
28
28
|
29
29
= help: the trait `Iterator` is not implemented for `[RangeFrom<{integer}>; 1]`
30
-
= note: see <https://github.com/rust-lang/rust/pull/65819> for more details
30
+
= 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
31
31
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeFrom<{integer}>; 1]`
32
32
= note: required by `into_iter`
33
33
34
34
error[E0277]: `[RangeTo<{integer}>; 1]` is not an iterator
35
35
--> $DIR/array-of-ranges.rs:8:14
36
36
|
37
37
LL | for _ in [..1] {}
38
-
| ^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
38
+
| ^^^^^ if you meant to iterate until a value, remove the square brackets and add a starting value
39
39
|
40
40
= help: the trait `Iterator` is not implemented for `[RangeTo<{integer}>; 1]`
41
-
= note: see <https://github.com/rust-lang/rust/pull/65819> for more details
41
+
= note: `[..end]` is an array of one `RangeTo`; you might have meant to have a bounded `Range` without the brackets: `0..end`
42
42
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeTo<{integer}>; 1]`
43
43
= note: required by `into_iter`
44
44
45
45
error[E0277]: `[RangeToInclusive<{integer}>; 1]` is not an iterator
46
46
--> $DIR/array-of-ranges.rs:10:14
47
47
|
48
48
LL | for _ in [..=1] {}
49
-
| ^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
49
+
| ^^^^^^ if you meant to iterate until a value (including it), remove the square brackets and add a starting value
50
50
|
51
51
= help: the trait `Iterator` is not implemented for `[RangeToInclusive<{integer}>; 1]`
52
-
= note: see <https://github.com/rust-lang/rust/pull/65819> for more details
52
+
= note: `[..=end]` is an array of one `RangeToInclusive`; you might have meant to have a bounded `RangeInclusive` without the brackets: `0..=end`
53
53
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeToInclusive<{integer}>; 1]`
54
54
= note: required by `into_iter`
55
55
@@ -90,10 +90,10 @@ error[E0277]: `[RangeInclusive<{integer}>; 1]` is not an iterator
90
90
--> $DIR/array-of-ranges.rs:21:14
91
91
|
92
92
LL | for _ in [0..=1] {}
93
-
| ^^^^^^^ arrays do not yet implement `IntoIterator`; try using `std::array::IntoIter::new(arr)`
93
+
| ^^^^^^^ if you meant to iterate between two values, remove the square brackets
94
94
|
95
95
= help: the trait `Iterator` is not implemented for `[RangeInclusive<{integer}>; 1]`
96
-
= note: see <https://github.com/rust-lang/rust/pull/65819> for more details
96
+
= note: `[start..=end]` is an array of one `RangeInclusive`; you might have meant to have a `RangeInclusive` without the brackets: `start..=end`
97
97
= note: required because of the requirements on the impl of `IntoIterator` for `[RangeInclusive<{integer}>; 1]`
0 commit comments