11error: this loop could be written as a `while let` loop
2- --> $DIR/while_loop.rs:6 :5
2+ --> $DIR/while_loop.rs:7 :5
33 |
44LL | / loop {
55LL | | if let Some(_x) = y {
@@ -13,7 +13,7 @@ LL | | }
1313 = note: `-D clippy::while-let-loop` implied by `-D warnings`
1414
1515error: this loop could be written as a `while let` loop
16- --> $DIR/while_loop.rs:20 :5
16+ --> $DIR/while_loop.rs:21 :5
1717 |
1818LL | / loop {
1919LL | | match y {
@@ -24,7 +24,7 @@ LL | | }
2424 | |_____^ help: try: `while let Some(_x) = y { .. }`
2525
2626error: this loop could be written as a `while let` loop
27- --> $DIR/while_loop.rs:26 :5
27+ --> $DIR/while_loop.rs:27 :5
2828 |
2929LL | / loop {
3030LL | | let x = match y {
@@ -36,7 +36,7 @@ LL | | }
3636 | |_____^ help: try: `while let Some(x) = y { .. }`
3737
3838error: this loop could be written as a `while let` loop
39- --> $DIR/while_loop.rs:34 :5
39+ --> $DIR/while_loop.rs:35 :5
4040 |
4141LL | / loop {
4242LL | | let x = match y {
@@ -48,7 +48,7 @@ LL | | }
4848 | |_____^ help: try: `while let Some(x) = y { .. }`
4949
5050error: this loop could be written as a `while let` loop
51- --> $DIR/while_loop.rs:62 :5
51+ --> $DIR/while_loop.rs:63 :5
5252 |
5353LL | / loop {
5454LL | | let (e, l) = match "".split_whitespace().next() {
@@ -60,27 +60,27 @@ LL | | }
6060 | |_____^ help: try: `while let Some(word) = "".split_whitespace().next() { .. }`
6161
6262error: this loop could be written as a `for` loop
63- --> $DIR/while_loop.rs:72 :33
63+ --> $DIR/while_loop.rs:73 :33
6464 |
6565LL | while let Option::Some(x) = iter.next() {
6666 | ^^^^^^^^^^^ help: try: `for x in iter { .. }`
6767 |
6868 = note: `-D clippy::while-let-on-iterator` implied by `-D warnings`
6969
7070error: this loop could be written as a `for` loop
71- --> $DIR/while_loop.rs:77 :25
71+ --> $DIR/while_loop.rs:78 :25
7272 |
7373LL | while let Some(x) = iter.next() {
7474 | ^^^^^^^^^^^ help: try: `for x in iter { .. }`
7575
7676error: this loop could be written as a `for` loop
77- --> $DIR/while_loop.rs:82 :25
77+ --> $DIR/while_loop.rs:83 :25
7878 |
7979LL | while let Some(_) = iter.next() {}
8080 | ^^^^^^^^^^^ help: try: `for _ in iter { .. }`
8181
8282error: this loop could be written as a `while let` loop
83- --> $DIR/while_loop.rs:125 :5
83+ --> $DIR/while_loop.rs:126 :5
8484 |
8585LL | / loop {
8686LL | | let _ = match iter.next() {
@@ -92,24 +92,30 @@ LL | | }
9292 | |_____^ help: try: `while let Some(ele) = iter.next() { .. }`
9393
9494error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
95- --> $DIR/while_loop.rs:130 :9
95+ --> $DIR/while_loop.rs:131 :9
9696 |
9797LL | loop {}
9898 | ^^^^^^^
9999 |
100100 = note: `-D clippy::empty-loop` implied by `-D warnings`
101101
102102error: this loop could be written as a `for` loop
103- --> $DIR/while_loop.rs:188 :29
103+ --> $DIR/while_loop.rs:189 :29
104104 |
105105LL | while let Some(v) = y.next() {
106106 | ^^^^^^^^ help: try: `for v in y { .. }`
107107
108108error: this loop could be written as a `for` loop
109- --> $DIR/while_loop.rs:216 :26
109+ --> $DIR/while_loop.rs:217 :26
110110 |
111111LL | while let Some(..) = values.iter().next() {
112112 | ^^^^^^^^^^^^^^^^^^^^ help: try: `for _ in values.iter() { .. }`
113113
114- error: aborting due to 12 previous errors
114+ error: this loop could be written as a `for` loop
115+ --> $DIR/while_loop.rs:251:32
116+ |
117+ LL | while let Some([..]) = it.next() {}
118+ | ^^^^^^^^^ help: try: `for [..] in it { .. }`
119+
120+ error: aborting due to 13 previous errors
115121
0 commit comments