]> git.lizzy.rs Git - rust.git/blob - tests/ui/while_loop.stderr
Merge pull request #1715 from Manishearth/rustup
[rust.git] / tests / ui / while_loop.stderr
1 error: this loop could be written as a `while let` loop
2   --> $DIR/while_loop.rs:9:5
3    |
4 9  | /     loop {
5 10 | |
6 11 | |
7 12 | |
8 ...  |
9 17 | |         }
10 18 | |     }
11    | |_____^ help: try `while let Some(_x) = y { .. }`
12    |
13 note: lint level defined here
14   --> $DIR/while_loop.rs:4:9
15    |
16 4  | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
17    |         ^^^^^^^^^^^^^^
18
19 error: this loop could be written as a `while let` loop
20   --> $DIR/while_loop.rs:25:5
21    |
22 25 | /     loop {
23 26 | |
24 27 | |
25 28 | |
26 ...  |
27 32 | |         };
28 33 | |     }
29    | |_____^ help: try `while let Some(_x) = y { .. }`
30
31 error: this loop could be written as a `while let` loop
32   --> $DIR/while_loop.rs:34:5
33    |
34 34 | /     loop {
35 35 | |
36 36 | |
37 37 | |
38 ...  |
39 43 | |         let _str = "foo";
40 44 | |     }
41    | |_____^ help: try `while let Some(x) = y { .. }`
42
43 error: this loop could be written as a `while let` loop
44   --> $DIR/while_loop.rs:45:5
45    |
46 45 | /     loop {
47 46 | |
48 47 | |
49 48 | |
50 ...  |
51 54 | |         { let _b = "foobar"; }
52 55 | |     }
53    | |_____^ help: try `while let Some(x) = y { .. }`
54
55 error: this loop could be written as a `while let` loop
56   --> $DIR/while_loop.rs:70:5
57    |
58 70 | /     loop {
59 71 | |
60 72 | |
61 73 | |
62 ...  |
63 79 | |         let _ = (e, l);
64 80 | |     }
65    | |_____^ help: try `while let Some(word) = "".split_whitespace().next() { .. }`
66
67 error: this loop could be written as a `for` loop
68   --> $DIR/while_loop.rs:83:5
69    |
70 83 | /     while let Option::Some(x) = iter.next() {
71 84 | |
72 85 | |
73 86 | |
74 87 | |         println!("{}", x);
75 88 | |     }
76    | |_____^ help: try `for x in iter { .. }`
77    |
78 note: lint level defined here
79   --> $DIR/while_loop.rs:4:37
80    |
81 4  | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
82    |                                     ^^^^^^^^^^^^^^^^^^^^^
83
84 error: this loop could be written as a `for` loop
85   --> $DIR/while_loop.rs:91:5
86    |
87 91 | /     while let Some(x) = iter.next() {
88 92 | |
89 93 | |
90 94 | |
91 95 | |         println!("{}", x);
92 96 | |     }
93    | |_____^ help: try `for x in iter { .. }`
94
95 error: this loop could be written as a `for` loop
96   --> $DIR/while_loop.rs:99:5
97    |
98 99 |     while let Some(_) = iter.next() {}
99    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `for _ in iter { .. }`
100
101 error: this loop could be written as a `while let` loop
102    --> $DIR/while_loop.rs:142:5
103     |
104 142 | /     loop {
105 143 | |
106 144 | |
107 145 | |
108 ...   |
109 150 | |         loop {}
110 151 | |     }
111     | |_____^ help: try `while let Some(ele) = iter.next() { .. }`
112
113 error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body.
114    --> $DIR/while_loop.rs:150:9
115     |
116 150 |         loop {}
117     |         ^^^^^^^
118     |
119 note: lint level defined here
120    --> $DIR/while_loop.rs:4:25
121     |
122 4   | #![deny(while_let_loop, empty_loop, while_let_on_iterator)]
123     |                         ^^^^^^^^^^
124
125 error: aborting due to 10 previous errors
126