2017-02-07 14:05:30 -06:00
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:9:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
9 | / loop {
|
2017-04-10 08:36:07 -05:00
|
|
|
10 | |
|
|
|
|
11 | |
|
|
|
|
12 | |
|
|
|
|
... |
|
|
|
|
17 | | }
|
|
|
|
18 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(_x) = y { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/while_loop.rs:4:9
|
|
|
|
|
|
|
|
|
4 | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:25:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
25 | / loop {
|
2017-02-08 07:58:07 -06:00
|
|
|
26 | |
|
|
|
|
27 | |
|
|
|
|
28 | |
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-02-07 14:05:30 -06:00
|
|
|
32 | | };
|
|
|
|
33 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(_x) = y { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:34:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
34 | / loop {
|
2017-04-10 08:36:07 -05:00
|
|
|
35 | |
|
|
|
|
36 | |
|
|
|
|
37 | |
|
|
|
|
... |
|
|
|
|
43 | | let _str = "foo";
|
|
|
|
44 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(x) = y { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:45:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
45 | / loop {
|
2017-04-10 08:36:07 -05:00
|
|
|
46 | |
|
|
|
|
47 | |
|
|
|
|
48 | |
|
|
|
|
... |
|
|
|
|
54 | | { let _b = "foobar"; }
|
|
|
|
55 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(x) = y { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:70:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
70 | / loop {
|
2017-04-10 08:36:07 -05:00
|
|
|
71 | |
|
|
|
|
72 | |
|
|
|
|
73 | |
|
|
|
|
... |
|
|
|
|
79 | | let _ = (e, l);
|
|
|
|
80 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(word) = "".split_whitespace().next() { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `for` loop
|
|
|
|
--> $DIR/while_loop.rs:83:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
83 | / while let Option::Some(x) = iter.next() {
|
2017-02-08 07:58:07 -06:00
|
|
|
84 | |
|
|
|
|
85 | |
|
|
|
|
86 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
87 | | println!("{}", x);
|
|
|
|
88 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `for x in iter { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/while_loop.rs:4:37
|
|
|
|
|
|
|
|
|
4 | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: this loop could be written as a `for` loop
|
|
|
|
--> $DIR/while_loop.rs:91:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
91 | / while let Some(x) = iter.next() {
|
2017-02-08 07:58:07 -06:00
|
|
|
92 | |
|
|
|
|
93 | |
|
|
|
|
94 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
95 | | println!("{}", x);
|
|
|
|
96 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `for x in iter { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `for` loop
|
|
|
|
--> $DIR/while_loop.rs:99:5
|
|
|
|
|
|
|
|
|
99 | while let Some(_) = iter.next() {}
|
2017-05-03 05:51:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `for _ in iter { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this loop could be written as a `while let` loop
|
|
|
|
--> $DIR/while_loop.rs:142:5
|
|
|
|
|
|
2017-04-23 08:25:22 -05:00
|
|
|
142 | / loop {
|
2017-04-10 08:36:07 -05:00
|
|
|
143 | |
|
|
|
|
144 | |
|
|
|
|
145 | |
|
|
|
|
... |
|
|
|
|
150 | | loop {}
|
|
|
|
151 | | }
|
2017-05-03 05:51:47 -05:00
|
|
|
| |_____^ help: try `while let Some(ele) = iter.next() { .. }`
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
|
|
|
|
--> $DIR/while_loop.rs:150:9
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
150 | loop {}
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/while_loop.rs:4:25
|
|
|
|
|
|
|
|
|
4 | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
|