]> git.lizzy.rs Git - rust.git/blob - tests/ui/while_let_on_iterator.stderr
Auto merge of #8639 - Jarcho:trivially_copy_pass_by_ref_5953, r=dswij
[rust.git] / tests / ui / while_let_on_iterator.stderr
1 error: this loop could be written as a `for` loop
2   --> $DIR/while_let_on_iterator.rs:15:5
3    |
4 LL |     while let Option::Some(x) = iter.next() {
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in iter`
6    |
7    = note: `-D clippy::while-let-on-iterator` implied by `-D warnings`
8
9 error: this loop could be written as a `for` loop
10   --> $DIR/while_let_on_iterator.rs:20:5
11    |
12 LL |     while let Some(x) = iter.next() {
13    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in iter`
14
15 error: this loop could be written as a `for` loop
16   --> $DIR/while_let_on_iterator.rs:25:5
17    |
18 LL |     while let Some(_) = iter.next() {}
19    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in iter`
20
21 error: this loop could be written as a `for` loop
22   --> $DIR/while_let_on_iterator.rs:101:9
23    |
24 LL |         while let Some([..]) = it.next() {}
25    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for [..] in it`
26
27 error: this loop could be written as a `for` loop
28   --> $DIR/while_let_on_iterator.rs:108:9
29    |
30 LL |         while let Some([_x]) = it.next() {}
31    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for [_x] in it`
32
33 error: this loop could be written as a `for` loop
34   --> $DIR/while_let_on_iterator.rs:121:9
35    |
36 LL |         while let Some(x @ [_]) = it.next() {
37    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x @ [_] in it`
38
39 error: this loop could be written as a `for` loop
40   --> $DIR/while_let_on_iterator.rs:141:9
41    |
42 LL |         while let Some(_) = y.next() {
43    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in y`
44
45 error: this loop could be written as a `for` loop
46   --> $DIR/while_let_on_iterator.rs:198:9
47    |
48 LL |         while let Some(m) = it.next() {
49    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it.by_ref()`
50
51 error: this loop could be written as a `for` loop
52   --> $DIR/while_let_on_iterator.rs:209:5
53    |
54 LL |     while let Some(n) = it.next() {
55    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in it`
56
57 error: this loop could be written as a `for` loop
58   --> $DIR/while_let_on_iterator.rs:211:9
59    |
60 LL |         while let Some(m) = it.next() {
61    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
62
63 error: this loop could be written as a `for` loop
64   --> $DIR/while_let_on_iterator.rs:220:9
65    |
66 LL |         while let Some(m) = it.next() {
67    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it`
68
69 error: this loop could be written as a `for` loop
70   --> $DIR/while_let_on_iterator.rs:229:9
71    |
72 LL |         while let Some(m) = it.next() {
73    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it.by_ref()`
74
75 error: this loop could be written as a `for` loop
76   --> $DIR/while_let_on_iterator.rs:246:9
77    |
78 LL |         while let Some(m) = it.next() {
79    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for m in it.by_ref()`
80
81 error: this loop could be written as a `for` loop
82   --> $DIR/while_let_on_iterator.rs:261:13
83    |
84 LL |             while let Some(i) = self.0.next() {
85    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in self.0.by_ref()`
86
87 error: manual `!RangeInclusive::contains` implementation
88   --> $DIR/while_let_on_iterator.rs:262:20
89    |
90 LL |                 if i < 3 || i > 7 {
91    |                    ^^^^^^^^^^^^^^ help: use: `!(3..=7).contains(&i)`
92    |
93    = note: `-D clippy::manual-range-contains` implied by `-D warnings`
94
95 error: this loop could be written as a `for` loop
96   --> $DIR/while_let_on_iterator.rs:293:13
97    |
98 LL |             while let Some(i) = self.0.0.0.next() {
99    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for i in self.0.0.0.by_ref()`
100
101 error: this loop could be written as a `for` loop
102   --> $DIR/while_let_on_iterator.rs:322:5
103    |
104 LL |     while let Some(n) = it.next() {
105    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for n in it.by_ref()`
106
107 error: this loop could be written as a `for` loop
108   --> $DIR/while_let_on_iterator.rs:334:9
109    |
110 LL |         while let Some(x) = it.next() {
111    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in it.by_ref()`
112
113 error: this loop could be written as a `for` loop
114   --> $DIR/while_let_on_iterator.rs:348:5
115    |
116 LL |     while let Some(x) = it.next() {
117    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in it.by_ref()`
118
119 error: this loop could be written as a `for` loop
120   --> $DIR/while_let_on_iterator.rs:359:5
121    |
122 LL |     while let Some(x) = it.0.next() {
123    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in it.0.by_ref()`
124
125 error: this loop could be written as a `for` loop
126   --> $DIR/while_let_on_iterator.rs:394:5
127    |
128 LL |     while let Some(x) = s.x.next() {
129    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in s.x.by_ref()`
130
131 error: this loop could be written as a `for` loop
132   --> $DIR/while_let_on_iterator.rs:401:5
133    |
134 LL |     while let Some(x) = x[0].next() {
135    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for x in x[0].by_ref()`
136
137 error: this loop could be written as a `for` loop
138   --> $DIR/while_let_on_iterator.rs:408:5
139    |
140 LL |     while let Some(..) = it.next() {
141    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in it`
142
143 error: aborting due to 23 previous errors
144