1
- error[E0599 ]: `usize` is not an iterator
1
+ error[E0689 ]: can't call method `rev` on type `usize`
2
2
--> $DIR/issue-90315.rs:4:28
3
3
|
4
4
LL | for _i in 0..arr.len().rev() {
5
- | ^^^ `usize` is not an iterator
5
+ | ^^^ can't call method `rev` on type `usize`
6
6
|
7
7
help: you must surround the range in parentheses to call the `rev` function
8
8
|
9
9
LL | for _i in (0..arr.len()).rev() {
10
10
| + +
11
11
12
- error[E0599 ]: `{integer}` is not an iterator
12
+ error[E0689 ]: can't call method `rev` on type `{integer}`
13
13
--> $DIR/issue-90315.rs:12:20
14
14
|
15
15
LL | for i in 1..11.rev() {
16
- | ^^^ `{integer}` is not an iterator
16
+ | ^^^ can't call method `rev` on type `{integer}`
17
17
|
18
18
help: you must surround the range in parentheses to call the `rev` function
19
19
|
20
20
LL | for i in (1..11).rev() {
21
21
| + +
22
22
23
- error[E0599 ]: `usize` is not an iterator
23
+ error[E0689 ]: can't call method `rev` on type `usize`
24
24
--> $DIR/issue-90315.rs:18:21
25
25
|
26
26
LL | for i in 1..end.rev() {
27
- | ^^^ `usize` is not an iterator
27
+ | ^^^ can't call method `rev` on type `usize`
28
28
|
29
29
help: you must surround the range in parentheses to call the `rev` function
30
30
|
31
31
LL | for i in (1..end).rev() {
32
32
| + +
33
33
34
- error[E0599 ]: `usize` is not an iterator
34
+ error[E0689 ]: can't call method `rev` on type `usize`
35
35
--> $DIR/issue-90315.rs:23:27
36
36
|
37
37
LL | for i in 1..(end + 1).rev() {
38
- | ^^^ `usize` is not an iterator
38
+ | ^^^ can't call method `rev` on type `usize`
39
39
|
40
40
help: you must surround the range in parentheses to call the `rev` function
41
41
|
42
42
LL | for i in (1..(end + 1)).rev() {
43
43
| + +
44
44
45
- error[E0599 ]: `usize` is not an iterator
45
+ error[E0689 ]: can't call method `is_empty` on type `usize`
46
46
--> $DIR/issue-90315.rs:28:21
47
47
|
48
48
LL | if 1..(end + 1).is_empty() {
49
- | ^^^^^^^^ `usize` is not an iterator
49
+ | ^^^^^^^^ can't call method `is_empty` on type `usize`
50
50
|
51
51
help: you must surround the range in parentheses to call the `is_empty` function
52
52
|
@@ -62,11 +62,11 @@ LL | if 1..(end + 1).is_empty() {
62
62
= note: expected type `bool`
63
63
found struct `std::ops::Range<{integer}>`
64
64
65
- error[E0599 ]: `usize` is not an iterator
65
+ error[E0689 ]: can't call method `is_sorted` on type `usize`
66
66
--> $DIR/issue-90315.rs:34:21
67
67
|
68
68
LL | if 1..(end + 1).is_sorted() {
69
- | ^^^^^^^^^ `usize` is not an iterator
69
+ | ^^^^^^^^^ can't call method `is_sorted` on type `usize`
70
70
|
71
71
help: you must surround the range in parentheses to call the `is_sorted` function
72
72
|
@@ -82,11 +82,11 @@ LL | if 1..(end + 1).is_sorted() {
82
82
= note: expected type `bool`
83
83
found struct `std::ops::Range<{integer}>`
84
84
85
- error[E0599 ]: `{integer}` is not an iterator
85
+ error[E0689 ]: can't call method `take` on type `{integer}`
86
86
--> $DIR/issue-90315.rs:40:26
87
87
|
88
88
LL | let _res: i32 = 3..6.take(2).sum();
89
- | ^^^^ `{integer}` is not an iterator
89
+ | ^^^^ can't call method `take` on type `{integer}`
90
90
|
91
91
help: you must surround the range in parentheses to call the `take` function
92
92
|
@@ -104,11 +104,11 @@ LL | let _res: i32 = 3..6.take(2).sum();
104
104
= note: expected type `i32`
105
105
found struct `std::ops::Range<{integer}>`
106
106
107
- error[E0599 ]: `{integer}` is not an iterator
107
+ error[E0689 ]: can't call method `sum` on type `{integer}`
108
108
--> $DIR/issue-90315.rs:45:26
109
109
|
110
110
LL | let _sum: i32 = 3..6.sum();
111
- | ^^^ `{integer}` is not an iterator
111
+ | ^^^ can't call method `sum` on type `{integer}`
112
112
|
113
113
help: you must surround the range in parentheses to call the `sum` function
114
114
|
@@ -126,22 +126,22 @@ LL | let _sum: i32 = 3..6.sum();
126
126
= note: expected type `i32`
127
127
found struct `std::ops::Range<{integer}>`
128
128
129
- error[E0599 ]: `usize` is not an iterator
129
+ error[E0689 ]: can't call method `rev` on type `usize`
130
130
--> $DIR/issue-90315.rs:53:21
131
131
|
132
132
LL | for _a in a..=b.rev() {
133
- | ^^^ `usize` is not an iterator
133
+ | ^^^ can't call method `rev` on type `usize`
134
134
|
135
135
help: you must surround the range in parentheses to call the `rev` function
136
136
|
137
137
LL | for _a in (a..=b).rev() {
138
138
| + +
139
139
140
- error[E0599 ]: `{integer}` is not an iterator
140
+ error[E0689 ]: can't call method `contains` on type `{integer}`
141
141
--> $DIR/issue-90315.rs:58:21
142
142
|
143
143
LL | let _res = ..10.contains(3);
144
- | ^^^^^^^^ `{integer}` is not an iterator
144
+ | ^^^^^^^^ can't call method `contains` on type `{integer}`
145
145
|
146
146
help: you must surround the range in parentheses to call the `contains` function
147
147
|
@@ -173,7 +173,29 @@ LL | let _res = b.take(1)..a;
173
173
`usize: Iterator`
174
174
which is required by `&mut usize: Iterator`
175
175
176
- error: aborting due to 17 previous errors
176
+ error[E0689]: can't call method `take` on ambiguous numeric type `{integer}`
177
+ --> $DIR/issue-90315.rs:71:25
178
+ |
179
+ LL | let _res: i32 = ..6.take(2).sum();
180
+ | ^^^^
181
+ |
182
+ help: you must specify a concrete type for this numeric value, like `i32`
183
+ |
184
+ LL | let _res: i32 = ..6_i32.take(2).sum();
185
+ | ~~~~~
186
+
187
+ error[E0308]: mismatched types
188
+ --> $DIR/issue-90315.rs:71:21
189
+ |
190
+ LL | let _res: i32 = ..6.take(2).sum();
191
+ | --- ^^^^^^^^^^^^^^^^^ expected `i32`, found struct `RangeTo`
192
+ | |
193
+ | expected due to this
194
+ |
195
+ = note: expected type `i32`
196
+ found struct `RangeTo<_>`
197
+
198
+ error: aborting due to 19 previous errors
177
199
178
- Some errors have detailed explanations: E0308, E0599.
200
+ Some errors have detailed explanations: E0308, E0599, E0689 .
179
201
For more information about an error, try `rustc --explain E0308`.
0 commit comments