rust-clippy/tests/ui/never_loop.stderr
Andre Bogus 505eb53d29 New never loop lint
This lint detects loops that unconditionally break or return.

Closes #257
2017-02-17 04:53:14 +01:00

41 lines
927 B
Text

error: this loop never actually loops
--> $DIR/never_loop.rs:8:5
|
8 | loop {
| _____^ starting here...
9 | | println!("This is only ever printed once");
10 | | break;
11 | | }
| |_____^ ...ending here
|
note: lint level defined here
--> $DIR/never_loop.rs:4:9
|
4 | #![deny(never_loop)]
| ^^^^^^^^^^
error: this loop never actually loops
--> $DIR/never_loop.rs:21:5
|
21 | loop {
| _____^ starting here...
22 | | loop {
23 | | // another one
24 | | break;
25 | | }
26 | | break;
27 | | }
| |_____^ ...ending here
error: this loop never actually loops
--> $DIR/never_loop.rs:22:9
|
22 | loop {
| _________^ starting here...
23 | | // another one
24 | | break;
25 | | }
| |_________^ ...ending here
error: aborting due to 3 previous errors