]> git.lizzy.rs Git - rust.git/blob - tests/ui/for_loop.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / for_loop.stderr
1 error: this range is empty so this for loop will never run
2   --> $DIR/for_loop.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.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.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.rs:51:14
35    |
36 LL |     for i in 5..5 {
37    |              ^^^^
38
39 error: this range is empty so this for loop will never run
40   --> $DIR/for_loop.rs:76:14
41    |
42 LL |     for i in 10..5 + 4 {
43    |              ^^^^^^^^^
44 help: consider using the following if you are attempting to iterate over this range in reverse
45    |
46 LL |     for i in (5 + 4..10).rev() {
47    |              ^^^^^^^^^^^^^^^^^
48
49 error: this range is empty so this for loop will never run
50   --> $DIR/for_loop.rs:80:14
51    |
52 LL |     for i in (5 + 2)..(3 - 1) {
53    |              ^^^^^^^^^^^^^^^^
54 help: consider using the following if you are attempting to iterate over this range in reverse
55    |
56 LL |     for i in ((3 - 1)..(5 + 2)).rev() {
57    |              ^^^^^^^^^^^^^^^^^^^^^^^^
58
59 error: this range is empty so this for loop will never run
60   --> $DIR/for_loop.rs:84:14
61    |
62 LL |     for i in (5 + 2)..(8 - 1) {
63    |              ^^^^^^^^^^^^^^^^
64
65 error: it is more concise to loop over references to containers instead of using explicit iteration methods
66   --> $DIR/for_loop.rs:106:15
67    |
68 LL |     for _v in vec.iter() {}
69    |               ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
70    |
71    = note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
72
73 error: it is more concise to loop over references to containers instead of using explicit iteration methods
74   --> $DIR/for_loop.rs:108:15
75    |
76 LL |     for _v in vec.iter_mut() {}
77    |               ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
78
79 error: it is more concise to loop over containers instead of using explicit iteration methods`
80   --> $DIR/for_loop.rs:111:15
81    |
82 LL |     for _v in out_vec.into_iter() {}
83    |               ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
84    |
85    = note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
86
87 error: it is more concise to loop over references to containers instead of using explicit iteration methods
88   --> $DIR/for_loop.rs:114:15
89    |
90 LL |     for _v in array.into_iter() {}
91    |               ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
92
93 error: it is more concise to loop over references to containers instead of using explicit iteration methods
94   --> $DIR/for_loop.rs:119:15
95    |
96 LL |     for _v in [1, 2, 3].iter() {}
97    |               ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
98
99 error: it is more concise to loop over references to containers instead of using explicit iteration methods
100   --> $DIR/for_loop.rs:123:15
101    |
102 LL |     for _v in [0; 32].iter() {}
103    |               ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
104
105 error: it is more concise to loop over references to containers instead of using explicit iteration methods
106   --> $DIR/for_loop.rs:128:15
107    |
108 LL |     for _v in ll.iter() {}
109    |               ^^^^^^^^^ help: to write this more concisely, try: `&ll`
110
111 error: it is more concise to loop over references to containers instead of using explicit iteration methods
112   --> $DIR/for_loop.rs:131:15
113    |
114 LL |     for _v in vd.iter() {}
115    |               ^^^^^^^^^ help: to write this more concisely, try: `&vd`
116
117 error: it is more concise to loop over references to containers instead of using explicit iteration methods
118   --> $DIR/for_loop.rs:134:15
119    |
120 LL |     for _v in bh.iter() {}
121    |               ^^^^^^^^^ help: to write this more concisely, try: `&bh`
122
123 error: it is more concise to loop over references to containers instead of using explicit iteration methods
124   --> $DIR/for_loop.rs:137:15
125    |
126 LL |     for _v in hm.iter() {}
127    |               ^^^^^^^^^ help: to write this more concisely, try: `&hm`
128
129 error: it is more concise to loop over references to containers instead of using explicit iteration methods
130   --> $DIR/for_loop.rs:140:15
131    |
132 LL |     for _v in bt.iter() {}
133    |               ^^^^^^^^^ help: to write this more concisely, try: `&bt`
134
135 error: it is more concise to loop over references to containers instead of using explicit iteration methods
136   --> $DIR/for_loop.rs:143:15
137    |
138 LL |     for _v in hs.iter() {}
139    |               ^^^^^^^^^ help: to write this more concisely, try: `&hs`
140
141 error: it is more concise to loop over references to containers instead of using explicit iteration methods
142   --> $DIR/for_loop.rs:146:15
143    |
144 LL |     for _v in bs.iter() {}
145    |               ^^^^^^^^^ help: to write this more concisely, try: `&bs`
146
147 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
148   --> $DIR/for_loop.rs:148:15
149    |
150 LL |     for _v in vec.iter().next() {}
151    |               ^^^^^^^^^^^^^^^^^
152    |
153    = note: `-D clippy::iter-next-loop` implied by `-D warnings`
154
155 error: the loop variable `i` is only used to index `vec`.
156   --> $DIR/for_loop.rs:281:14
157    |
158 LL |     for i in ZERO..vec.len() {
159    |              ^^^^^^^^^^^^^^^
160    |
161    = note: `-D clippy::needless-range-loop` implied by `-D warnings`
162 help: consider using an iterator
163    |
164 LL |     for <item> in &vec {
165    |         ^^^^^^    ^^^^
166
167 error: aborting due to 22 previous errors
168