blob: 0466bb0a0c997dab3eca1b2e1218ae520b39fe13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
error[E0689]: can't call method `rev` on type `usize`
--> $DIR/issue-90315.rs:4:28
|
LL | for _i in 0..arr.len().rev() {
| ^^^ can't call method `rev` on type `usize`
|
help: you must surround the range in parentheses to call its `rev` function
|
LL | for _i in (0..arr.len()).rev() {
| + +
error[E0689]: can't call method `rev` on type `{integer}`
--> $DIR/issue-90315.rs:12:20
|
LL | for i in 1..11.rev() {
| ^^^ can't call method `rev` on type `{integer}`
|
help: you must surround the range in parentheses to call its `rev` function
|
LL | for i in (1..11).rev() {
| + +
error[E0689]: can't call method `rev` on type `usize`
--> $DIR/issue-90315.rs:18:21
|
LL | for i in 1..end.rev() {
| ^^^ can't call method `rev` on type `usize`
|
help: you must surround the range in parentheses to call its `rev` function
|
LL | for i in (1..end).rev() {
| + +
error[E0689]: can't call method `rev` on type `usize`
--> $DIR/issue-90315.rs:23:27
|
LL | for i in 1..(end + 1).rev() {
| ^^^ can't call method `rev` on type `usize`
|
help: you must surround the range in parentheses to call its `rev` function
|
LL | for i in (1..(end + 1)).rev() {
| + +
error[E0689]: can't call method `is_empty` on type `usize`
--> $DIR/issue-90315.rs:28:21
|
LL | if 1..(end + 1).is_empty() {
| ^^^^^^^^ can't call method `is_empty` on type `usize`
|
help: you must surround the range in parentheses to call its `is_empty` function
|
LL | if (1..(end + 1)).is_empty() {
| + +
error[E0308]: mismatched types
--> $DIR/issue-90315.rs:28:8
|
LL | if 1..(end + 1).is_empty() {
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
error[E0689]: can't call method `is_sorted` on type `usize`
--> $DIR/issue-90315.rs:34:21
|
LL | if 1..(end + 1).is_sorted() {
| ^^^^^^^^^ can't call method `is_sorted` on type `usize`
|
help: you must surround the range in parentheses to call its `is_sorted` function
|
LL | if (1..(end + 1)).is_sorted() {
| + +
error[E0308]: mismatched types
--> $DIR/issue-90315.rs:34:8
|
LL | if 1..(end + 1).is_sorted() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
error[E0689]: can't call method `take` on type `{integer}`
--> $DIR/issue-90315.rs:40:26
|
LL | let _res: i32 = 3..6.take(2).sum();
| ^^^^ can't call method `take` on type `{integer}`
|
help: you must surround the range in parentheses to call its `take` function
|
LL | let _res: i32 = (3..6).take(2).sum();
| + +
error[E0308]: mismatched types
--> $DIR/issue-90315.rs:40:21
|
LL | let _res: i32 = 3..6.take(2).sum();
| --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found `Range<{integer}>`
| |
| expected due to this
|
= note: expected type `i32`
found struct `std::ops::Range<{integer}>`
error[E0689]: can't call method `sum` on type `{integer}`
--> $DIR/issue-90315.rs:45:26
|
LL | let _sum: i32 = 3..6.sum();
| ^^^ can't call method `sum` on type `{integer}`
|
help: you must surround the range in parentheses to call its `sum` function
|
LL | let _sum: i32 = (3..6).sum();
| + +
error[E0308]: mismatched types
--> $DIR/issue-90315.rs:45:21
|
LL | let _sum: i32 = 3..6.sum();
| --- ^^^^^^^^^^ expected `i32`, found `Range<{integer}>`
| |
| expected due to this
|
= note: expected type `i32`
found struct `std::ops::Range<{integer}>`
error[E0689]: can't call method `rev` on type `usize`
--> $DIR/issue-90315.rs:53:21
|
LL | for _a in a..=b.rev() {
| ^^^ can't call method `rev` on type `usize`
|
help: you must surround the range in parentheses to call its `rev` function
|
LL | for _a in (a..=b).rev() {
| + +
error[E0689]: can't call method `contains` on type `{integer}`
--> $DIR/issue-90315.rs:58:21
|
LL | let _res = ..10.contains(3);
| ^^^^^^^^ can't call method `contains` on type `{integer}`
|
help: you must surround the range in parentheses to call its `contains` function
|
LL | let _res = (..10).contains(3);
| + +
error[E0599]: no method named `error_method` found for type `usize` in the current scope
--> $DIR/issue-90315.rs:62:15
|
LL | if 1..end.error_method() {
| ^^^^^^^^^^^^ method not found in `usize`
error[E0308]: mismatched types
--> $DIR/issue-90315.rs:62:8
|
LL | if 1..end.error_method() {
| ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<{integer}>`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
error[E0599]: `usize` is not an iterator
--> $DIR/issue-90315.rs:68:18
|
LL | let _res = b.take(1)..a;
| ^^^^ `usize` is not an iterator
|
= note: the following trait bounds were not satisfied:
`usize: Iterator`
which is required by `&mut usize: Iterator`
error[E0689]: can't call method `take` on ambiguous numeric type `{integer}`
--> $DIR/issue-90315.rs:71:25
|
LL | let _res: i32 = ..6.take(2).sum();
| ^^^^
|
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | let _res: i32 = ..6_i32.take(2).sum();
| ~~~~~
error: aborting due to 18 previous errors
Some errors have detailed explanations: E0308, E0599, E0689.
For more information about an error, try `rustc --explain E0308`.
|