2017-02-17 04:53:14 +01:00
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:17:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
17 | / loop { // clippy::never_loop
|
|
|
|
18 | | x += 1;
|
|
|
|
19 | | if x == 1 {
|
|
|
|
20 | | return
|
|
|
|
21 | | }
|
|
|
|
22 | | break;
|
|
|
|
23 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-08-01 16:30:44 +02:00
|
|
|
= note: #[deny(clippy::never_loop)] on by default
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:38:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
38 | / loop { // never loops
|
|
|
|
39 | | x += 1;
|
|
|
|
40 | | break
|
|
|
|
41 | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-17 04:53:14 +01:00
|
|
|
|
2017-06-01 06:22:15 +02:00
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:57:2
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
57 | loop { // never loops
|
2017-12-07 11:20:48 +01:00
|
|
|
| _____^
|
2018-10-06 18:18:06 +02:00
|
|
|
58 | | while i == 0 { // never loops
|
|
|
|
59 | | break
|
|
|
|
60 | | }
|
|
|
|
61 | | return
|
|
|
|
62 | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_____^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:58:9
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
58 | / while i == 0 { // never loops
|
|
|
|
59 | | break
|
|
|
|
60 | | }
|
2017-06-01 06:22:15 +02:00
|
|
|
| |_________^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:69:3
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
69 | loop { // never loops
|
2017-12-07 11:20:48 +01:00
|
|
|
| _________^
|
2018-10-06 18:18:06 +02:00
|
|
|
70 | | if x == 5 { break }
|
|
|
|
71 | | continue 'outer
|
|
|
|
72 | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_________^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:102:5
|
|
|
|
|
|
|
|
|
102 | / while let Some(y) = x { // never loops
|
|
|
|
103 | | return
|
|
|
|
104 | | }
|
|
|
|
| |_____^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:108:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
108 | / for x in 0..10 { // never loops
|
|
|
|
109 | | match x {
|
|
|
|
110 | | 1 => break,
|
|
|
|
111 | | _ => return,
|
|
|
|
112 | | }
|
|
|
|
113 | | }
|
2017-06-01 06:22:15 +02:00
|
|
|
| |_____^
|
|
|
|
|
2017-10-09 00:26:39 +02:00
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:154:5
|
2017-10-09 00:26:39 +02:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
154 | / 'outer: while a { // never loops
|
|
|
|
155 | | while a {
|
|
|
|
156 | | if a {
|
|
|
|
157 | | a = false;
|
2017-10-09 00:26:39 +02:00
|
|
|
... |
|
2018-10-06 18:18:06 +02:00
|
|
|
161 | | break 'outer;
|
|
|
|
162 | | }
|
2017-10-09 00:26:39 +02:00
|
|
|
| |_____^
|
|
|
|
|
2017-11-05 15:43:28 +01:00
|
|
|
error: this loop never actually loops
|
2018-10-06 18:18:06 +02:00
|
|
|
--> $DIR/never_loop.rs:168:9
|
2017-11-05 15:43:28 +01:00
|
|
|
|
|
2018-10-06 18:18:06 +02:00
|
|
|
168 | / while false {
|
|
|
|
169 | | break 'label;
|
|
|
|
170 | | }
|
2017-11-05 15:43:28 +01:00
|
|
|
| |_________^
|
|
|
|
|
2018-01-16 17:06:27 +01:00
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|