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
+54-4
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,49 @@ LL | for _ in [0..1] {}
8
8
= note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end`
9
9
= note: required by `std::iter::IntoIterator::into_iter`
10
10
11
-
error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
11
+
error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
12
+
--> $DIR/array-of-ranges.rs:3: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:4: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
12
32
--> $DIR/array-of-ranges.rs:5:14
13
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:6: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:9:14
53
+
|
14
54
LL | for _ in [start..end] {}
15
55
| ^^^^^^^^^^^^ if you meant to iterate between two values, remove the square brackets
16
56
|
@@ -19,7 +59,7 @@ LL | for _ in [start..end] {}
19
59
= note: required by `std::iter::IntoIterator::into_iter`
20
60
21
61
error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator
22
-
--> $DIR/array-of-ranges.rs:7:14
62
+
--> $DIR/array-of-ranges.rs:11:14
23
63
|
24
64
LL | for _ in array_of_range {}
25
65
| ^^^^^^^^^^^^^^ if you meant to iterate between two values, remove the square brackets
@@ -29,7 +69,7 @@ LL | for _ in array_of_range {}
29
69
= note: required by `std::iter::IntoIterator::into_iter`
30
70
31
71
error[E0277]: `[std::ops::Range<{integer}>; 2]` is not an iterator
32
-
--> $DIR/array-of-ranges.rs:8:14
72
+
--> $DIR/array-of-ranges.rs:12:14
33
73
|
34
74
LL | for _ in [0..1, 2..3] {}
35
75
| ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
@@ -38,6 +78,16 @@ LL | for _ in [0..1, 2..3] {}
38
78
= note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
39
79
= note: required by `std::iter::IntoIterator::into_iter`
40
80
41
-
error: aborting due to 4 previous errors
81
+
error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
82
+
--> $DIR/array-of-ranges.rs:13: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
42
92
43
93
For more information about this error, try `rustc --explain E0277`.
0 commit comments