]> git.lizzy.rs Git - rust.git/blob - tests/ui/for_loop_fixable.stderr
for_loop: Split test into fixable/unfixable, make needless_range_loop use updated...
[rust.git] / tests / ui / for_loop_fixable.stderr
1 error: this range is empty so this for loop will never run
2   --> $DIR/for_loop_fixable.rs:39:14
3    |
4 LL |     for i in 10..0 {
5    |              ^^^^^
6    |
7    = note: `-D clippy::reverse-range-loop` implied by `-D warnings`
8 help: consider using the following if you are attempting to iterate over this range in reverse
9    |
10 LL |     for i in (0..10).rev() {
11    |              ^^^^^^^^^^^^^
12
13 error: this range is empty so this for loop will never run
14   --> $DIR/for_loop_fixable.rs:43:14
15    |
16 LL |     for i in 10..=0 {
17    |              ^^^^^^
18 help: consider using the following if you are attempting to iterate over this range in reverse
19    |
20 LL |     for i in (0..=10).rev() {
21    |              ^^^^^^^^^^^^^^
22
23 error: this range is empty so this for loop will never run
24   --> $DIR/for_loop_fixable.rs:47:14
25    |
26 LL |     for i in MAX_LEN..0 {
27    |              ^^^^^^^^^^
28 help: consider using the following if you are attempting to iterate over this range in reverse
29    |
30 LL |     for i in (0..MAX_LEN).rev() {
31    |              ^^^^^^^^^^^^^^^^^^
32
33 error: this range is empty so this for loop will never run
34   --> $DIR/for_loop_fixable.rs:72:14
35    |
36 LL |     for i in 10..5 + 4 {
37    |              ^^^^^^^^^
38 help: consider using the following if you are attempting to iterate over this range in reverse
39    |
40 LL |     for i in (5 + 4..10).rev() {
41    |              ^^^^^^^^^^^^^^^^^
42
43 error: this range is empty so this for loop will never run
44   --> $DIR/for_loop_fixable.rs:76:14
45    |
46 LL |     for i in (5 + 2)..(3 - 1) {
47    |              ^^^^^^^^^^^^^^^^
48 help: consider using the following if you are attempting to iterate over this range in reverse
49    |
50 LL |     for i in ((3 - 1)..(5 + 2)).rev() {
51    |              ^^^^^^^^^^^^^^^^^^^^^^^^
52
53 error: it is more concise to loop over references to containers instead of using explicit iteration methods
54   --> $DIR/for_loop_fixable.rs:98:15
55    |
56 LL |     for _v in vec.iter() {}
57    |               ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
58    |
59    = note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
60
61 error: it is more concise to loop over references to containers instead of using explicit iteration methods
62   --> $DIR/for_loop_fixable.rs:100:15
63    |
64 LL |     for _v in vec.iter_mut() {}
65    |               ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
66
67 error: it is more concise to loop over containers instead of using explicit iteration methods`
68   --> $DIR/for_loop_fixable.rs:103:15
69    |
70 LL |     for _v in out_vec.into_iter() {}
71    |               ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
72    |
73    = note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
74
75 error: it is more concise to loop over references to containers instead of using explicit iteration methods
76   --> $DIR/for_loop_fixable.rs:106:15
77    |
78 LL |     for _v in array.into_iter() {}
79    |               ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
80
81 error: it is more concise to loop over references to containers instead of using explicit iteration methods
82   --> $DIR/for_loop_fixable.rs:111:15
83    |
84 LL |     for _v in [1, 2, 3].iter() {}
85    |               ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
86
87 error: it is more concise to loop over references to containers instead of using explicit iteration methods
88   --> $DIR/for_loop_fixable.rs:115:15
89    |
90 LL |     for _v in [0; 32].iter() {}
91    |               ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
92
93 error: it is more concise to loop over references to containers instead of using explicit iteration methods
94   --> $DIR/for_loop_fixable.rs:120:15
95    |
96 LL |     for _v in ll.iter() {}
97    |               ^^^^^^^^^ help: to write this more concisely, try: `&ll`
98
99 error: it is more concise to loop over references to containers instead of using explicit iteration methods
100   --> $DIR/for_loop_fixable.rs:123:15
101    |
102 LL |     for _v in vd.iter() {}
103    |               ^^^^^^^^^ help: to write this more concisely, try: `&vd`
104
105 error: it is more concise to loop over references to containers instead of using explicit iteration methods
106   --> $DIR/for_loop_fixable.rs:126:15
107    |
108 LL |     for _v in bh.iter() {}
109    |               ^^^^^^^^^ help: to write this more concisely, try: `&bh`
110
111 error: it is more concise to loop over references to containers instead of using explicit iteration methods
112   --> $DIR/for_loop_fixable.rs:129:15
113    |
114 LL |     for _v in hm.iter() {}
115    |               ^^^^^^^^^ help: to write this more concisely, try: `&hm`
116
117 error: it is more concise to loop over references to containers instead of using explicit iteration methods
118   --> $DIR/for_loop_fixable.rs:132:15
119    |
120 LL |     for _v in bt.iter() {}
121    |               ^^^^^^^^^ help: to write this more concisely, try: `&bt`
122
123 error: it is more concise to loop over references to containers instead of using explicit iteration methods
124   --> $DIR/for_loop_fixable.rs:135:15
125    |
126 LL |     for _v in hs.iter() {}
127    |               ^^^^^^^^^ help: to write this more concisely, try: `&hs`
128
129 error: it is more concise to loop over references to containers instead of using explicit iteration methods
130   --> $DIR/for_loop_fixable.rs:138:15
131    |
132 LL |     for _v in bs.iter() {}
133    |               ^^^^^^^^^ help: to write this more concisely, try: `&bs`
134
135 error: aborting due to 18 previous errors
136