2017-02-17 03:53:14 +00:00
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:7:5
|
2017-02-17 03:53:14 +00:00
|
|
|
|
|
2017-06-01 04:22:15 +00:00
|
|
|
7 | / loop { // never_loop
|
|
|
|
8 | | x += 1;
|
|
|
|
9 | | if x == 1 {
|
|
|
|
10 | | return
|
|
|
|
11 | | }
|
|
|
|
12 | | break;
|
|
|
|
13 | | }
|
2017-04-23 13:25:22 +00:00
|
|
|
| |_____^
|
2017-02-17 03:53:14 +00:00
|
|
|
|
|
2017-05-17 12:19:44 +00:00
|
|
|
= note: `-D never-loop` implied by `-D warnings`
|
2017-02-17 03:53:14 +00:00
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:28:5
|
2017-02-17 03:53:14 +00:00
|
|
|
|
|
2017-06-01 04:22:15 +00:00
|
|
|
28 | / loop { // never loops
|
|
|
|
29 | | x += 1;
|
|
|
|
30 | | break
|
|
|
|
31 | | }
|
2017-04-23 13:25:22 +00:00
|
|
|
| |_____^
|
2017-02-17 03:53:14 +00:00
|
|
|
|
2017-06-01 04:22:15 +00:00
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:47:2
|
2017-06-01 04:22:15 +00:00
|
|
|
|
|
2017-09-14 04:18:34 +00:00
|
|
|
47 | / loop { // never loops
|
|
|
|
48 | | while i == 0 { // never loops
|
|
|
|
49 | | break
|
|
|
|
50 | | }
|
|
|
|
51 | | return
|
|
|
|
52 | | }
|
2017-06-01 04:22:15 +00:00
|
|
|
| |__^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:48:9
|
2017-06-01 04:22:15 +00:00
|
|
|
|
|
|
|
|
48 | / while i == 0 { // never loops
|
|
|
|
49 | | break
|
|
|
|
50 | | }
|
|
|
|
| |_________^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:59:3
|
2017-06-01 04:22:15 +00:00
|
|
|
|
|
2017-09-14 04:18:34 +00:00
|
|
|
59 | / loop { // never loops
|
|
|
|
60 | | if x == 5 { break }
|
|
|
|
61 | | continue 'outer
|
|
|
|
62 | | }
|
2017-06-01 04:22:15 +00:00
|
|
|
| |___^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:92:5
|
2017-06-01 04:22:15 +00:00
|
|
|
|
|
|
|
|
92 | / while let Some(y) = x { // never loops
|
|
|
|
93 | | return
|
|
|
|
94 | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this loop never actually loops
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/never_loop.rs:98:5
|
2017-06-01 04:22:15 +00:00
|
|
|
|
|
|
|
|
98 | / for x in 0..10 { // never loops
|
|
|
|
99 | | match x {
|
|
|
|
100 | | 1 => break,
|
|
|
|
101 | | _ => return,
|
|
|
|
102 | | }
|
|
|
|
103 | | }
|
|
|
|
| |_____^
|
|
|
|
|
2017-10-08 22:26:39 +00:00
|
|
|
error: this loop never actually loops
|
|
|
|
--> $DIR/never_loop.rs:144:5
|
|
|
|
|
|
|
|
|
144 | / 'outer: while a { // never loops
|
|
|
|
145 | | while a {
|
|
|
|
146 | | if a {
|
|
|
|
147 | | a = false;
|
|
|
|
... |
|
|
|
|
151 | | break 'outer;
|
|
|
|
152 | | }
|
|
|
|
| |_____^
|
|
|
|
|
2017-11-05 14:43:28 +00:00
|
|
|
error: this loop never actually loops
|
|
|
|
--> $DIR/never_loop.rs:158:9
|
|
|
|
|
|
|
|
|
158 | / while false {
|
|
|
|
159 | | break 'label;
|
|
|
|
160 | | }
|
|
|
|
| |_________^
|
|
|
|
|