rust-clippy/tests/ui/never_loop.stderr

169 lines
3.3 KiB
Text
Raw Normal View History

error: this loop never actually loops
--> $DIR/never_loop.rs:12:5
|
2018-12-27 15:57:55 +00:00
LL | / loop {
LL | |
LL | |
2018-12-27 15:57:55 +00:00
LL | | // clippy::never_loop
2018-12-10 05:27:19 +00:00
... |
2018-12-27 15:57:55 +00:00
LL | | break;
LL | | }
| |_____^
|
= note: `#[deny(clippy::never_loop)]` on by default
error: this loop never actually loops
--> $DIR/never_loop.rs:36:5
|
2018-12-27 15:57:55 +00:00
LL | / loop {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | x += 1;
LL | | break;
LL | | }
| |_____^
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:57:5
2017-06-01 04:22:15 +00:00
|
2018-12-27 15:57:55 +00:00
LL | / loop {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | while i == 0 {
2018-12-10 05:27:19 +00:00
... |
2018-12-27 15:57:55 +00:00
LL | | return;
LL | | }
| |_____^
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:60:9
2017-06-01 04:22:15 +00:00
|
2018-12-27 15:57:55 +00:00
LL | / while i == 0 {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | break;
LL | | }
2017-06-01 04:22:15 +00:00
| |_________^
error: this loop never actually loops
--> $DIR/never_loop.rs:73:9
2017-06-01 04:22:15 +00:00
|
2018-12-27 15:57:55 +00:00
LL | / loop {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | if x == 5 {
... |
2018-12-27 15:57:55 +00:00
LL | | continue 'outer;
LL | | }
| |_________^
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:110:5
2018-12-27 15:57:55 +00:00
|
LL | / while let Some(y) = x {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | return;
LL | | }
| |_____^
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:118:5
2018-12-27 15:57:55 +00:00
|
LL | / for x in 0..10 {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | match x {
... |
2018-12-27 15:57:55 +00:00
LL | | }
LL | | }
| |_____^
|
help: if you need the first element of the iterator, try writing
|
LL | if let Some(x) = (0..10).next() {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-06-01 04:22:15 +00:00
2017-10-08 22:26:39 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:167:5
2018-12-27 15:57:55 +00:00
|
LL | / 'outer: while a {
LL | |
2018-12-27 15:57:55 +00:00
LL | | // never loops
LL | | while a {
... |
LL | | break 'outer;
LL | | }
| |_____^
2017-10-08 22:26:39 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:183:9
2018-12-27 15:57:55 +00:00
|
LL | / while false {
LL | |
2018-12-27 15:57:55 +00:00
LL | | break 'label;
LL | | }
| |_________^
error: this loop never actually loops
--> $DIR/never_loop.rs:235:13
|
LL | let _ = loop {
| _____________^
LL | |
LL | | let Some(x) = x else {
LL | | return;
... |
LL | | break x;
LL | | };
| |_____^
2022-11-16 06:09:09 +00:00
error: this loop never actually loops
--> $DIR/never_loop.rs:257:5
2022-11-16 06:09:09 +00:00
|
LL | / 'a: loop {
LL | |
2022-11-16 06:09:09 +00:00
LL | | 'b: {
LL | | break 'b 'c: {
... |
2022-11-16 06:09:09 +00:00
LL | | }
LL | | }
| |_____^
2023-05-15 19:46:24 +00:00
error: sub-expression diverges
--> $DIR/never_loop.rs:261:17
2023-05-15 19:46:24 +00:00
|
LL | break 'a;
| ^^^^^^^^
|
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
error: this loop never actually loops
--> $DIR/never_loop.rs:294:13
|
LL | / for _ in 0..20 {
LL | |
LL | | break 'block;
LL | | }
| |_____________^
|
help: if you need the first element of the iterator, try writing
|
LL | if let Some(_) = (0..20).next() {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: this loop never actually loops
--> $DIR/never_loop.rs:339:5
|
LL | / loop {
LL | |
LL | | 'label: {
LL | | let x = true;
... |
LL | | }
LL | | }
| |_____^
error: aborting due to 14 previous errors
2018-01-16 16:06:27 +00:00