]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/needless_range_loop.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / needless_range_loop.stderr
CommitLineData
f20569fa
XL
1error: the loop variable `i` is only used to index `vec`
2 --> $DIR/needless_range_loop.rs:10:14
3 |
4LL | for i in 0..vec.len() {
5 | ^^^^^^^^^^^^
6 |
7 = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8help: consider using an iterator
9 |
10LL | for <item> in &vec {
94222f64 11 | ~~~~~~ ~~~~
f20569fa
XL
12
13error: the loop variable `i` is only used to index `vec`
14 --> $DIR/needless_range_loop.rs:19:14
15 |
16LL | for i in 0..vec.len() {
17 | ^^^^^^^^^^^^
18 |
19help: consider using an iterator
20 |
21LL | for <item> in &vec {
94222f64 22 | ~~~~~~ ~~~~
f20569fa
XL
23
24error: the loop variable `j` is only used to index `STATIC`
25 --> $DIR/needless_range_loop.rs:24:14
26 |
27LL | for j in 0..4 {
28 | ^^^^
29 |
30help: consider using an iterator
31 |
32LL | for <item> in &STATIC {
94222f64 33 | ~~~~~~ ~~~~~~~
f20569fa
XL
34
35error: the loop variable `j` is only used to index `CONST`
36 --> $DIR/needless_range_loop.rs:28:14
37 |
38LL | for j in 0..4 {
39 | ^^^^
40 |
41help: consider using an iterator
42 |
43LL | for <item> in &CONST {
94222f64 44 | ~~~~~~ ~~~~~~
f20569fa
XL
45
46error: the loop variable `i` is used to index `vec`
47 --> $DIR/needless_range_loop.rs:32:14
48 |
49LL | for i in 0..vec.len() {
50 | ^^^^^^^^^^^^
51 |
52help: consider using an iterator
53 |
54LL | for (i, <item>) in vec.iter().enumerate() {
94222f64 55 | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
56
57error: the loop variable `i` is only used to index `vec2`
58 --> $DIR/needless_range_loop.rs:40:14
59 |
60LL | for i in 0..vec.len() {
61 | ^^^^^^^^^^^^
62 |
63help: consider using an iterator
64 |
65LL | for <item> in vec2.iter().take(vec.len()) {
94222f64 66 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
67
68error: the loop variable `i` is only used to index `vec`
69 --> $DIR/needless_range_loop.rs:44:14
70 |
71LL | for i in 5..vec.len() {
72 | ^^^^^^^^^^^^
73 |
74help: consider using an iterator
75 |
76LL | for <item> in vec.iter().skip(5) {
94222f64 77 | ~~~~~~ ~~~~~~~~~~~~~~~~~~
f20569fa
XL
78
79error: the loop variable `i` is only used to index `vec`
80 --> $DIR/needless_range_loop.rs:48:14
81 |
82LL | for i in 0..MAX_LEN {
83 | ^^^^^^^^^^
84 |
85help: consider using an iterator
86 |
87LL | for <item> in vec.iter().take(MAX_LEN) {
94222f64 88 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
89
90error: the loop variable `i` is only used to index `vec`
91 --> $DIR/needless_range_loop.rs:52:14
92 |
93LL | for i in 0..=MAX_LEN {
94 | ^^^^^^^^^^^
95 |
96help: consider using an iterator
97 |
98LL | for <item> in vec.iter().take(MAX_LEN + 1) {
94222f64 99 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
100
101error: the loop variable `i` is only used to index `vec`
102 --> $DIR/needless_range_loop.rs:56:14
103 |
104LL | for i in 5..10 {
105 | ^^^^^
106 |
107help: consider using an iterator
108 |
109LL | for <item> in vec.iter().take(10).skip(5) {
94222f64 110 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
111
112error: the loop variable `i` is only used to index `vec`
113 --> $DIR/needless_range_loop.rs:60:14
114 |
115LL | for i in 5..=10 {
116 | ^^^^^^
117 |
118help: consider using an iterator
119 |
120LL | for <item> in vec.iter().take(10 + 1).skip(5) {
94222f64 121 | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
122
123error: the loop variable `i` is used to index `vec`
124 --> $DIR/needless_range_loop.rs:64:14
125 |
126LL | for i in 5..vec.len() {
127 | ^^^^^^^^^^^^
128 |
129help: consider using an iterator
130 |
131LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
94222f64 132 | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
133
134error: the loop variable `i` is used to index `vec`
135 --> $DIR/needless_range_loop.rs:68:14
136 |
137LL | for i in 5..10 {
138 | ^^^^^
139 |
140help: consider using an iterator
141 |
142LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
94222f64 143 | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
144
145error: the loop variable `i` is used to index `vec`
146 --> $DIR/needless_range_loop.rs:73:14
147 |
148LL | for i in 0..vec.len() {
149 | ^^^^^^^^^^^^
150 |
151help: consider using an iterator
152 |
153LL | for (i, <item>) in vec.iter_mut().enumerate() {
94222f64 154 | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
f20569fa
XL
155
156error: aborting due to 14 previous errors
157