fork/rust

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

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

master
2.4 KiB92 linesraw
1error: the loop variable `i` is only used to index `ns`
2  --> $DIR/needless_range_loop2.rs:11:14
3   |
4LL |     for i in 3..10 {
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 ns.iter().take(10).skip(3) {
12   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~
13
14error: the loop variable `i` is only used to index `ms`
15  --> $DIR/needless_range_loop2.rs:34:14
16   |
17LL |     for i in 0..ms.len() {
18   |              ^^^^^^^^^^^
19   |
20help: consider using an iterator
21   |
22LL |     for <item> in &mut ms {
23   |         ~~~~~~    ~~~~~~~
24
25error: the loop variable `i` is only used to index `ms`
26  --> $DIR/needless_range_loop2.rs:41:14
27   |
28LL |     for i in 0..ms.len() {
29   |              ^^^^^^^^^^^
30   |
31help: consider using an iterator
32   |
33LL |     for <item> in &mut ms {
34   |         ~~~~~~    ~~~~~~~
35
36error: the loop variable `i` is only used to index `vec`
37  --> $DIR/needless_range_loop2.rs:66:14
38   |
39LL |     for i in x..x + 4 {
40   |              ^^^^^^^^
41   |
42help: consider using an iterator
43   |
44LL |     for <item> in vec.iter_mut().skip(x).take(4) {
45   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46
47error: the loop variable `i` is only used to index `vec`
48  --> $DIR/needless_range_loop2.rs:74:14
49   |
50LL |     for i in x..=x + 4 {
51   |              ^^^^^^^^^
52   |
53help: consider using an iterator
54   |
55LL |     for <item> in vec.iter_mut().skip(x).take(4 + 1) {
56   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
58error: the loop variable `i` is only used to index `arr`
59  --> $DIR/needless_range_loop2.rs:81:14
60   |
61LL |     for i in 0..3 {
62   |              ^^^^
63   |
64help: consider using an iterator
65   |
66LL |     for <item> in &arr {
67   |         ~~~~~~    ~~~~
68
69error: the loop variable `i` is only used to index `arr`
70  --> $DIR/needless_range_loop2.rs:86:14
71   |
72LL |     for i in 0..2 {
73   |              ^^^^
74   |
75help: consider using an iterator
76   |
77LL |     for <item> in arr.iter().take(2) {
78   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
79
80error: the loop variable `i` is only used to index `arr`
81  --> $DIR/needless_range_loop2.rs:91:14
82   |
83LL |     for i in 1..3 {
84   |              ^^^^
85   |
86help: consider using an iterator
87   |
88LL |     for <item> in arr.iter().skip(1) {
89   |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
90
91error: aborting due to 8 previous errors
92