fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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