rust/tests/ui/never_loop.stderr

119 lines
2.5 KiB
Plaintext
Raw Normal View History

error: this loop never actually loops
--> $DIR/never_loop.rs:11:5
|
2018-12-27 09:57:55 -06:00
LL | / loop {
LL | | // clippy::never_loop
LL | | x += 1;
LL | | if x == 1 {
2018-12-09 23:27:19 -06:00
... |
2018-12-27 09:57:55 -06:00
LL | | break;
LL | | }
| |_____^
|
= note: `#[deny(clippy::never_loop)]` on by default
error: this loop never actually loops
--> $DIR/never_loop.rs:33:5
|
2018-12-27 09:57:55 -06:00
LL | / loop {
LL | | // never loops
LL | | x += 1;
LL | | break;
LL | | }
| |_____^
2017-05-31 23:22:15 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:53:5
2017-05-31 23:22:15 -05:00
|
2018-12-27 09:57:55 -06:00
LL | / loop {
LL | | // never loops
LL | | while i == 0 {
LL | | // never loops
2018-12-09 23:27:19 -06:00
... |
2018-12-27 09:57:55 -06:00
LL | | return;
LL | | }
| |_____^
2017-05-31 23:22:15 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:55:9
2017-05-31 23:22:15 -05:00
|
2018-12-27 09:57:55 -06:00
LL | / while i == 0 {
LL | | // never loops
LL | | break;
LL | | }
2017-05-31 23:22:15 -05:00
| |_________^
error: this loop never actually loops
--> $DIR/never_loop.rs:67:9
2017-05-31 23:22:15 -05:00
|
2018-12-27 09:57:55 -06:00
LL | / loop {
LL | | // never loops
LL | | if x == 5 {
LL | | break;
LL | | }
LL | | continue 'outer;
LL | | }
| |_________^
2017-05-31 23:22:15 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:103:5
2018-12-27 09:57:55 -06:00
|
LL | / while let Some(y) = x {
LL | | // never loops
LL | | return;
LL | | }
| |_____^
2017-05-31 23:22:15 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:110:5
2018-12-27 09:57:55 -06:00
|
LL | / for x in 0..10 {
LL | | // never loops
LL | | match x {
LL | | 1 => break,
LL | | _ => return,
LL | | }
LL | | }
| |_____^
|
help: if you need the first element of the iterator, try writing
|
LL | if let Some(x) = (0..10).next() {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-05-31 23:22:15 -05:00
2017-10-08 17:26:39 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:158:5
2018-12-27 09:57:55 -06:00
|
LL | / 'outer: while a {
LL | | // never loops
LL | | while a {
LL | | if a {
... |
LL | | break 'outer;
LL | | }
| |_____^
2017-10-08 17:26:39 -05:00
error: this loop never actually loops
--> $DIR/never_loop.rs:173:9
2018-12-27 09:57:55 -06:00
|
LL | / while false {
LL | | break 'label;
LL | | }
| |_________^
error: this loop never actually loops
--> $DIR/never_loop.rs:224:13
|
LL | let _ = loop {
| _____________^
LL | | let Some(x) = x else {
LL | | return;
LL | | };
LL | |
LL | | break x;
LL | | };
| |_____^
error: aborting due to 10 previous errors
2018-01-16 10:06:27 -06:00