2017-02-16 21:53:14 -06:00
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:19:5
|
2017-02-16 21:53:14 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
19 | / loop {
|
|
|
|
20 | | // clippy::never_loop
|
|
|
|
21 | | x += 1;
|
|
|
|
22 | | if x == 1 {
|
|
|
|
... |
|
|
|
|
25 | | break;
|
|
|
|
26 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-16 21:53:14 -06:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: #[deny(clippy::never_loop)] on by default
|
2017-02-16 21:53:14 -06:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:41:5
|
2017-02-16 21:53:14 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
41 | / loop {
|
|
|
|
42 | | // never loops
|
|
|
|
43 | | x += 1;
|
|
|
|
44 | | break;
|
|
|
|
45 | | }
|
2017-04-23 08:25:22 -05:00
|
|
|
| |_____^
|
2017-02-16 21:53:14 -06:00
|
|
|
|
2017-05-31 23:22:15 -05:00
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:61:5
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
61 | / loop {
|
|
|
|
62 | | // never loops
|
|
|
|
63 | | while i == 0 {
|
|
|
|
64 | | // never loops
|
|
|
|
... |
|
|
|
|
67 | | return;
|
|
|
|
68 | | }
|
2017-12-07 04:20:48 -06:00
|
|
|
| |_____^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:63:9
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
63 | / while i == 0 {
|
|
|
|
64 | | // never loops
|
|
|
|
65 | | break;
|
|
|
|
66 | | }
|
2017-05-31 23:22:15 -05:00
|
|
|
| |_________^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:75:9
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
75 | / loop {
|
|
|
|
76 | | // never loops
|
|
|
|
77 | | if x == 5 {
|
|
|
|
78 | | break;
|
|
|
|
79 | | }
|
|
|
|
80 | | continue 'outer;
|
|
|
|
81 | | }
|
2017-12-07 04:20:48 -06:00
|
|
|
| |_________^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:111:5
|
2018-10-06 11:18:06 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
111 | / while let Some(y) = x {
|
|
|
|
112 | | // never loops
|
|
|
|
113 | | return;
|
|
|
|
114 | | }
|
2018-10-06 11:18:06 -05:00
|
|
|
| |_____^
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:118:5
|
2017-05-31 23:22:15 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
118 | / for x in 0..10 {
|
|
|
|
119 | | // never loops
|
|
|
|
120 | | match x {
|
|
|
|
121 | | 1 => break,
|
|
|
|
122 | | _ => return,
|
|
|
|
123 | | }
|
|
|
|
124 | | }
|
2017-05-31 23:22:15 -05:00
|
|
|
| |_____^
|
|
|
|
|
2017-10-08 17:26:39 -05:00
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:166:5
|
2017-10-08 17:26:39 -05:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
166 | / 'outer: while a {
|
|
|
|
167 | | // never loops
|
|
|
|
168 | | while a {
|
|
|
|
169 | | if a {
|
2017-10-08 17:26:39 -05:00
|
|
|
... |
|
2018-12-09 23:27:19 -06:00
|
|
|
174 | | break 'outer;
|
|
|
|
175 | | }
|
2017-10-08 17:26:39 -05:00
|
|
|
| |_____^
|
|
|
|
|
2017-11-05 08:43:28 -06:00
|
|
|
error: this loop never actually loops
|
2018-12-09 23:27:19 -06:00
|
|
|
--> $DIR/never_loop.rs:181:9
|
2017-11-05 08:43:28 -06:00
|
|
|
|
|
2018-12-09 23:27:19 -06:00
|
|
|
181 | / while false {
|
|
|
|
182 | | break 'label;
|
|
|
|
183 | | }
|
2017-11-05 08:43:28 -06:00
|
|
|
| |_________^
|
|
|
|
|
2018-01-16 10:06:27 -06:00
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|