summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/needless_range_loop.stderr
blob: cffa19bec3a6661b9e8c1a7ad648d2254174319b (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
error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:11:14
   |
LL |     for i in 0..vec.len() {
   |              ^^^^^^^^^^^^
   |
   = note: `-D clippy::needless-range-loop` implied by `-D warnings`
help: consider using an iterator
   |
LL |     for <item> in &vec {
   |         ~~~~~~    ~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:20:14
   |
LL |     for i in 0..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in &vec {
   |         ~~~~~~    ~~~~

error: the loop variable `j` is only used to index `STATIC`
  --> $DIR/needless_range_loop.rs:25:14
   |
LL |     for j in 0..4 {
   |              ^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in &STATIC {
   |         ~~~~~~    ~~~~~~~

error: the loop variable `j` is only used to index `CONST`
  --> $DIR/needless_range_loop.rs:29:14
   |
LL |     for j in 0..4 {
   |              ^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in &CONST {
   |         ~~~~~~    ~~~~~~

error: the loop variable `i` is used to index `vec`
  --> $DIR/needless_range_loop.rs:33:14
   |
LL |     for i in 0..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator and enumerate()
   |
LL |     for (i, <item>) in vec.iter().enumerate() {
   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec2`
  --> $DIR/needless_range_loop.rs:41:14
   |
LL |     for i in 0..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec2.iter().take(vec.len()) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:45:14
   |
LL |     for i in 5..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec.iter().skip(5) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:49:14
   |
LL |     for i in 0..MAX_LEN {
   |              ^^^^^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec.iter().take(MAX_LEN) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:53:14
   |
LL |     for i in 0..=MAX_LEN {
   |              ^^^^^^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec.iter().take(MAX_LEN + 1) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:57:14
   |
LL |     for i in 5..10 {
   |              ^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec.iter().take(10).skip(5) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is only used to index `vec`
  --> $DIR/needless_range_loop.rs:61:14
   |
LL |     for i in 5..=10 {
   |              ^^^^^^
   |
help: consider using an iterator
   |
LL |     for <item> in vec.iter().take(10 + 1).skip(5) {
   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is used to index `vec`
  --> $DIR/needless_range_loop.rs:65:14
   |
LL |     for i in 5..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator and enumerate()
   |
LL |     for (i, <item>) in vec.iter().enumerate().skip(5) {
   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is used to index `vec`
  --> $DIR/needless_range_loop.rs:69:14
   |
LL |     for i in 5..10 {
   |              ^^^^^
   |
help: consider using an iterator and enumerate()
   |
LL |     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: the loop variable `i` is used to index `vec`
  --> $DIR/needless_range_loop.rs:74:14
   |
LL |     for i in 0..vec.len() {
   |              ^^^^^^^^^^^^
   |
help: consider using an iterator and enumerate()
   |
LL |     for (i, <item>) in vec.iter_mut().enumerate() {
   |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to 14 previous errors