11error[E0425]: cannot find value `while_loop` in this scope
2- --> $DIR/label_misspelled.rs:3 :9
2+ --> $DIR/label_misspelled.rs:6 :9
33 |
44LL | 'while_loop: while true {
55 | ----------- a label with a similar name exists
6+ LL |
67LL | while_loop;
78 | ^^^^^^^^^^ not found in this scope
89
910error[E0425]: cannot find value `while_let` in this scope
10- --> $DIR/label_misspelled.rs:7 :9
11+ --> $DIR/label_misspelled.rs:11 :9
1112 |
1213LL | 'while_let: while let Some(_) = Some(()) {
1314 | ---------- a label with a similar name exists
15+ LL |
1416LL | while_let;
1517 | ^^^^^^^^^ not found in this scope
1618
1719error[E0425]: cannot find value `for_loop` in this scope
18- --> $DIR/label_misspelled.rs:11 :9
20+ --> $DIR/label_misspelled.rs:16 :9
1921 |
2022LL | 'for_loop: for _ in 0..3 {
2123 | --------- a label with a similar name exists
24+ LL |
2225LL | for_loop;
2326 | ^^^^^^^^ not found in this scope
2427
2528error[E0425]: cannot find value `LOOP` in this scope
26- --> $DIR/label_misspelled.rs:15 :9
29+ --> $DIR/label_misspelled.rs:21 :9
2730 |
2831LL | 'LOOP: loop {
2932 | ----- a label with a similar name exists
33+ LL |
3034LL | LOOP;
3135 | ^^^^ not found in this scope
3236
3337error[E0425]: cannot find value `LOOP` in this scope
34- --> $DIR/label_misspelled.rs:22 :15
38+ --> $DIR/label_misspelled.rs:29 :15
3539 |
3640LL | 'LOOP: loop {
3741 | ----- a label with a similar name exists
42+ LL |
3843LL | break LOOP;
3944 | ^^^^
4045 | |
4146 | not found in this scope
4247 | help: use the similarly named label: `'LOOP`
4348
4449error[E0425]: cannot find value `while_loop` in this scope
45- --> $DIR/label_misspelled.rs:26 :15
50+ --> $DIR/label_misspelled.rs:34 :15
4651 |
4752LL | 'while_loop: while true {
4853 | ----------- a label with a similar name exists
54+ LL |
4955LL | break while_loop;
5056 | ^^^^^^^^^^
5157 | |
5258 | not found in this scope
5359 | help: use the similarly named label: `'while_loop`
5460
5561error[E0425]: cannot find value `while_let` in this scope
56- --> $DIR/label_misspelled.rs:30 :15
62+ --> $DIR/label_misspelled.rs:39 :15
5763 |
5864LL | 'while_let: while let Some(_) = Some(()) {
5965 | ---------- a label with a similar name exists
66+ LL |
6067LL | break while_let;
6168 | ^^^^^^^^^
6269 | |
6370 | not found in this scope
6471 | help: use the similarly named label: `'while_let`
6572
6673error[E0425]: cannot find value `for_loop` in this scope
67- --> $DIR/label_misspelled.rs:34 :15
74+ --> $DIR/label_misspelled.rs:44 :15
6875 |
6976LL | 'for_loop: for _ in 0..3 {
7077 | --------- a label with a similar name exists
78+ LL |
7179LL | break for_loop;
7280 | ^^^^^^^^
7381 | |
7482 | not found in this scope
7583 | help: use the similarly named label: `'for_loop`
7684
85+ warning: unused label
86+ --> $DIR/label_misspelled.rs:4:5
87+ |
88+ LL | 'while_loop: while true {
89+ | ^^^^^^^^^^^
90+ |
91+ note: the lint level is defined here
92+ --> $DIR/label_misspelled.rs:1:9
93+ |
94+ LL | #![warn(unused_labels)]
95+ | ^^^^^^^^^^^^^
96+
7797warning: denote infinite loops with `loop { ... }`
78- --> $DIR/label_misspelled.rs:2 :5
98+ --> $DIR/label_misspelled.rs:4 :5
7999 |
80100LL | 'while_loop: while true {
81101 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
82102 |
83103 = note: `#[warn(while_true)]` on by default
84104
105+ warning: unused label
106+ --> $DIR/label_misspelled.rs:9:5
107+ |
108+ LL | 'while_let: while let Some(_) = Some(()) {
109+ | ^^^^^^^^^^
110+
111+ warning: unused label
112+ --> $DIR/label_misspelled.rs:14:5
113+ |
114+ LL | 'for_loop: for _ in 0..3 {
115+ | ^^^^^^^^^
116+
117+ warning: unused label
118+ --> $DIR/label_misspelled.rs:19:5
119+ |
120+ LL | 'LOOP: loop {
121+ | ^^^^^
122+
123+ warning: unused label
124+ --> $DIR/label_misspelled.rs:27:5
125+ |
126+ LL | 'LOOP: loop {
127+ | ^^^^^
128+
129+ warning: unused label
130+ --> $DIR/label_misspelled.rs:32:5
131+ |
132+ LL | 'while_loop: while true {
133+ | ^^^^^^^^^^^
134+
85135warning: denote infinite loops with `loop { ... }`
86- --> $DIR/label_misspelled.rs:25 :5
136+ --> $DIR/label_misspelled.rs:32 :5
87137 |
88138LL | 'while_loop: while true {
89139 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
90140
141+ warning: unused label
142+ --> $DIR/label_misspelled.rs:37:5
143+ |
144+ LL | 'while_let: while let Some(_) = Some(()) {
145+ | ^^^^^^^^^^
146+
147+ warning: unused label
148+ --> $DIR/label_misspelled.rs:42:5
149+ |
150+ LL | 'for_loop: for _ in 0..3 {
151+ | ^^^^^^^^^
152+
153+ warning: unused label
154+ --> $DIR/label_misspelled.rs:51:5
155+ |
156+ LL | 'while_loop: while true {
157+ | ^^^^^^^^^^^
158+
91159warning: denote infinite loops with `loop { ... }`
92- --> $DIR/label_misspelled.rs:41 :5
160+ --> $DIR/label_misspelled.rs:51 :5
93161 |
94162LL | 'while_loop: while true {
95163 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
96164
165+ warning: unused label
166+ --> $DIR/label_misspelled.rs:56:5
167+ |
168+ LL | 'while_let: while let Some(_) = Some(()) {
169+ | ^^^^^^^^^^
170+
171+ warning: unused label
172+ --> $DIR/label_misspelled.rs:61:5
173+ |
174+ LL | 'for_loop: for _ in 0..3 {
175+ | ^^^^^^^^^
176+
97177error[E0571]: `break` with value from a `while` loop
98- --> $DIR/label_misspelled.rs:42 :9
178+ --> $DIR/label_misspelled.rs:53 :9
99179 |
100180LL | 'while_loop: while true {
101181 | ----------------------- you can't `break` with a value in a `while` loop
182+ LL |
102183LL | break foo;
103184 | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
104185 |
@@ -112,10 +193,11 @@ LL | break 'while_loop;
112193 | ^^^^^^^^^^^
113194
114195error[E0571]: `break` with value from a `while` loop
115- --> $DIR/label_misspelled.rs:46 :9
196+ --> $DIR/label_misspelled.rs:58 :9
116197 |
117198LL | 'while_let: while let Some(_) = Some(()) {
118199 | ---------------------------------------- you can't `break` with a value in a `while` loop
200+ LL |
119201LL | break foo;
120202 | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
121203 |
@@ -129,10 +211,11 @@ LL | break 'while_let;
129211 | ^^^^^^^^^^
130212
131213error[E0571]: `break` with value from a `for` loop
132- --> $DIR/label_misspelled.rs:50 :9
214+ --> $DIR/label_misspelled.rs:63 :9
133215 |
134216LL | 'for_loop: for _ in 0..3 {
135217 | ------------------------ you can't `break` with a value in a `for` loop
218+ LL |
136219LL | break foo;
137220 | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
138221 |
@@ -145,7 +228,7 @@ help: alternatively, you might have meant to use the available loop label
145228LL | break 'for_loop;
146229 | ^^^^^^^^^
147230
148- error: aborting due to 11 previous errors; 3 warnings emitted
231+ error: aborting due to 11 previous errors; 14 warnings emitted
149232
150233Some errors have detailed explanations: E0425, E0571.
151234For more information about an error, try `rustc --explain E0425`.
0 commit comments