]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_range_loop.stderr
Merge remote-tracking branch 'upstream/rust-1.39.0' into backport_merge
[rust.git] / tests / ui / needless_range_loop.stderr
1 error: the loop variable `i` is only used to index `ns`.
2   --> $DIR/needless_range_loop.rs:15:14
3    |
4 LL |     for i in 3..10 {
5    |              ^^^^^
6    |
7    = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8 help: consider using an iterator
9    |
10 LL |     for <item> in ns.iter().take(10).skip(3) {
11    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: the loop variable `i` is only used to index `ms`.
14   --> $DIR/needless_range_loop.rs:36:14
15    |
16 LL |     for i in 0..ms.len() {
17    |              ^^^^^^^^^^^
18    |
19 help: consider using an iterator
20    |
21 LL |     for <item> in &mut ms {
22    |         ^^^^^^    ^^^^^^^
23
24 error: the loop variable `i` is only used to index `ms`.
25   --> $DIR/needless_range_loop.rs:42:14
26    |
27 LL |     for i in 0..ms.len() {
28    |              ^^^^^^^^^^^
29    |
30 help: consider using an iterator
31    |
32 LL |     for <item> in &mut ms {
33    |         ^^^^^^    ^^^^^^^
34
35 error: the loop variable `i` is only used to index `vec`.
36   --> $DIR/needless_range_loop.rs:66:14
37    |
38 LL |     for i in x..x + 4 {
39    |              ^^^^^^^^
40    |
41 help: consider using an iterator
42    |
43 LL |     for <item> in vec.iter_mut().skip(x).take(4) {
44    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
46 error: the loop variable `i` is only used to index `vec`.
47   --> $DIR/needless_range_loop.rs:73:14
48    |
49 LL |     for i in x..=x + 4 {
50    |              ^^^^^^^^^
51    |
52 help: consider using an iterator
53    |
54 LL |     for <item> in vec.iter_mut().skip(x).take(4 + 1) {
55    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56
57 error: the loop variable `i` is only used to index `arr`.
58   --> $DIR/needless_range_loop.rs:79:14
59    |
60 LL |     for i in 0..3 {
61    |              ^^^^
62    |
63 help: consider using an iterator
64    |
65 LL |     for <item> in &arr {
66    |         ^^^^^^    ^^^^
67
68 error: the loop variable `i` is only used to index `arr`.
69   --> $DIR/needless_range_loop.rs:83:14
70    |
71 LL |     for i in 0..2 {
72    |              ^^^^
73    |
74 help: consider using an iterator
75    |
76 LL |     for <item> in arr.iter().take(2) {
77    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
78
79 error: the loop variable `i` is only used to index `arr`.
80   --> $DIR/needless_range_loop.rs:87:14
81    |
82 LL |     for i in 1..3 {
83    |              ^^^^
84    |
85 help: consider using an iterator
86    |
87 LL |     for <item> in arr.iter().skip(1) {
88    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
89
90 error: the loop variable `i` is only used to index `vec`.
91   --> $DIR/needless_range_loop.rs:93:14
92    |
93 LL |     for i in 0..vec.len() {
94    |              ^^^^^^^^^^^^
95    |
96 help: consider using an iterator
97    |
98 LL |     for <item> in &vec {
99    |         ^^^^^^    ^^^^
100
101 error: the loop variable `i` is only used to index `vec`.
102   --> $DIR/needless_range_loop.rs:102:14
103    |
104 LL |     for i in 0..vec.len() {
105    |              ^^^^^^^^^^^^
106    |
107 help: consider using an iterator
108    |
109 LL |     for <item> in &vec {
110    |         ^^^^^^    ^^^^
111
112 error: the loop variable `j` is only used to index `STATIC`.
113   --> $DIR/needless_range_loop.rs:107:14
114    |
115 LL |     for j in 0..4 {
116    |              ^^^^
117    |
118 help: consider using an iterator
119    |
120 LL |     for <item> in &STATIC {
121    |         ^^^^^^    ^^^^^^^
122
123 error: the loop variable `j` is only used to index `CONST`.
124   --> $DIR/needless_range_loop.rs:111:14
125    |
126 LL |     for j in 0..4 {
127    |              ^^^^
128    |
129 help: consider using an iterator
130    |
131 LL |     for <item> in &CONST {
132    |         ^^^^^^    ^^^^^^
133
134 error: the loop variable `i` is used to index `vec`
135   --> $DIR/needless_range_loop.rs:115:14
136    |
137 LL |     for i in 0..vec.len() {
138    |              ^^^^^^^^^^^^
139    |
140 help: consider using an iterator
141    |
142 LL |     for (i, <item>) in vec.iter().enumerate() {
143    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^
144
145 error: the loop variable `i` is only used to index `vec2`.
146   --> $DIR/needless_range_loop.rs:123:14
147    |
148 LL |     for i in 0..vec.len() {
149    |              ^^^^^^^^^^^^
150    |
151 help: consider using an iterator
152    |
153 LL |     for <item> in vec2.iter().take(vec.len()) {
154    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
155
156 error: the loop variable `i` is only used to index `vec`.
157   --> $DIR/needless_range_loop.rs:127:14
158    |
159 LL |     for i in 5..vec.len() {
160    |              ^^^^^^^^^^^^
161    |
162 help: consider using an iterator
163    |
164 LL |     for <item> in vec.iter().skip(5) {
165    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
166
167 error: the loop variable `i` is only used to index `vec`.
168   --> $DIR/needless_range_loop.rs:131:14
169    |
170 LL |     for i in 0..MAX_LEN {
171    |              ^^^^^^^^^^
172    |
173 help: consider using an iterator
174    |
175 LL |     for <item> in vec.iter().take(MAX_LEN) {
176    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^
177
178 error: the loop variable `i` is only used to index `vec`.
179   --> $DIR/needless_range_loop.rs:135:14
180    |
181 LL |     for i in 0..=MAX_LEN {
182    |              ^^^^^^^^^^^
183    |
184 help: consider using an iterator
185    |
186 LL |     for <item> in vec.iter().take(MAX_LEN + 1) {
187    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
189 error: the loop variable `i` is only used to index `vec`.
190   --> $DIR/needless_range_loop.rs:139:14
191    |
192 LL |     for i in 5..10 {
193    |              ^^^^^
194    |
195 help: consider using an iterator
196    |
197 LL |     for <item> in vec.iter().take(10).skip(5) {
198    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
199
200 error: the loop variable `i` is only used to index `vec`.
201   --> $DIR/needless_range_loop.rs:143:14
202    |
203 LL |     for i in 5..=10 {
204    |              ^^^^^^
205    |
206 help: consider using an iterator
207    |
208 LL |     for <item> in vec.iter().take(10 + 1).skip(5) {
209    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
211 error: the loop variable `i` is used to index `vec`
212   --> $DIR/needless_range_loop.rs:147:14
213    |
214 LL |     for i in 5..vec.len() {
215    |              ^^^^^^^^^^^^
216    |
217 help: consider using an iterator
218    |
219 LL |     for (i, <item>) in vec.iter().enumerate().skip(5) {
220    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221
222 error: the loop variable `i` is used to index `vec`
223   --> $DIR/needless_range_loop.rs:151:14
224    |
225 LL |     for i in 5..10 {
226    |              ^^^^^
227    |
228 help: consider using an iterator
229    |
230 LL |     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
231    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232
233 error: the loop variable `i` is used to index `vec`
234   --> $DIR/needless_range_loop.rs:156:14
235    |
236 LL |     for i in 0..vec.len() {
237    |              ^^^^^^^^^^^^
238    |
239 help: consider using an iterator
240    |
241 LL |     for (i, <item>) in vec.iter_mut().enumerate() {
242    |         ^^^^^^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^
243
244 error: aborting due to 22 previous errors
245