mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
94 lines
2 KiB
Text
94 lines
2 KiB
Text
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:17:5
|
|
|
|
|
17 | / loop { // clippy::never_loop
|
|
18 | | x += 1;
|
|
19 | | if x == 1 {
|
|
20 | | return
|
|
21 | | }
|
|
22 | | break;
|
|
23 | | }
|
|
| |_____^
|
|
|
|
|
= note: #[deny(clippy::never_loop)] on by default
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:38:5
|
|
|
|
|
38 | / loop { // never loops
|
|
39 | | x += 1;
|
|
40 | | break
|
|
41 | | }
|
|
| |_____^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:57:2
|
|
|
|
|
57 | loop { // never loops
|
|
| _____^
|
|
58 | | while i == 0 { // never loops
|
|
59 | | break
|
|
60 | | }
|
|
61 | | return
|
|
62 | | }
|
|
| |_____^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:58:9
|
|
|
|
|
58 | / while i == 0 { // never loops
|
|
59 | | break
|
|
60 | | }
|
|
| |_________^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:69:3
|
|
|
|
|
69 | loop { // never loops
|
|
| _________^
|
|
70 | | if x == 5 { break }
|
|
71 | | continue 'outer
|
|
72 | | }
|
|
| |_________^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:102:5
|
|
|
|
|
102 | / while let Some(y) = x { // never loops
|
|
103 | | return
|
|
104 | | }
|
|
| |_____^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:108:5
|
|
|
|
|
108 | / for x in 0..10 { // never loops
|
|
109 | | match x {
|
|
110 | | 1 => break,
|
|
111 | | _ => return,
|
|
112 | | }
|
|
113 | | }
|
|
| |_____^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:154:5
|
|
|
|
|
154 | / 'outer: while a { // never loops
|
|
155 | | while a {
|
|
156 | | if a {
|
|
157 | | a = false;
|
|
... |
|
|
161 | | break 'outer;
|
|
162 | | }
|
|
| |_____^
|
|
|
|
error: this loop never actually loops
|
|
--> $DIR/never_loop.rs:168:9
|
|
|
|
|
168 | / while false {
|
|
169 | | break 'label;
|
|
170 | | }
|
|
| |_________^
|
|
|
|
error: aborting due to 9 previous errors
|
|
|