2017-02-17 04:53:14 +01:00
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:10:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
|
|
|
LL | | // clippy::never_loop
|
|
|
|
LL | | x += 1;
|
|
|
|
LL | | if x == 1 {
|
2018-12-10 06:27:19 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | break;
|
|
|
|
LL | | }
|
2017-04-23 15:25:22 +02:00
|
|
|
| |_____^
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2019-07-19 00:35:32 +02:00
|
|
|
= note: `#[deny(clippy::never_loop)]` on by default
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:32:5
|
2017-02-17 04:53:14 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | x += 1;
|
|
|
|
LL | | break;
|
|
|
|
LL | | }
|
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
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:52:5
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | while i == 0 {
|
|
|
|
LL | | // never loops
|
2018-12-10 06:27:19 +01:00
|
|
|
... |
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | | return;
|
|
|
|
LL | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_____^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:54:9
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / while i == 0 {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | break;
|
|
|
|
LL | | }
|
2017-06-01 06:22:15 +02:00
|
|
|
| |_________^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:66:9
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | / loop {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | if x == 5 {
|
|
|
|
LL | | break;
|
|
|
|
LL | | }
|
|
|
|
LL | | continue 'outer;
|
|
|
|
LL | | }
|
2017-12-07 11:20:48 +01:00
|
|
|
| |_________^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:102:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | / while let Some(y) = x {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | return;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:109:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | / for x in 0..10 {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | match x {
|
|
|
|
LL | | 1 => break,
|
|
|
|
LL | | _ => return,
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2017-06-01 06:22:15 +02:00
|
|
|
|
2017-10-09 00:26:39 +02:00
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:157:5
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | / 'outer: while a {
|
|
|
|
LL | | // never loops
|
|
|
|
LL | | while a {
|
|
|
|
LL | | if a {
|
|
|
|
... |
|
|
|
|
LL | | break 'outer;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2017-10-09 00:26:39 +02:00
|
|
|
|
2017-11-05 15:43:28 +01:00
|
|
|
error: this loop never actually loops
|
2019-01-07 22:33:18 +01:00
|
|
|
--> $DIR/never_loop.rs:172:9
|
2018-12-27 16:57:55 +01:00
|
|
|
|
|
|
|
|
LL | / while false {
|
|
|
|
LL | | break 'label;
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
2017-11-05 15:43:28 +01:00
|
|
|
|
2018-01-16 17:06:27 +01:00
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|