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