]> git.lizzy.rs Git - rust.git/blob - tests/ui/for_loop.stderr
Auto merge of #4314 - chansuke:add-negation-to-is_empty, 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:40: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:44: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:48: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:52: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:77: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:81: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:85: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:107: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:109: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:112: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:115: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:120: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:124: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:129: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:132: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:135: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:138: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:141: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:144: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:147: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:149: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: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
156   --> $DIR/for_loop.rs:156:5
157    |
158 LL |     vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
159    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160    |
161    = note: `-D clippy::unused-collect` implied by `-D warnings`
162
163 error: aborting due to 22 previous errors
164