1- error[E0425]: cannot find value `LOOP` in this scope
2- --> $DIR/label_misspelled.rs:3:9
3- |
4- LL | 'LOOP: loop {
5- | ----- a label with a similar name exists
6- LL | LOOP;
7- | ^^^^ not found in this scope
8-
91error[E0425]: cannot find value `while_loop` in this scope
10- --> $DIR/label_misspelled.rs:7 :9
2+ --> $DIR/label_misspelled.rs:3 :9
113 |
124LL | 'while_loop: while true {
135 | ----------- a label with a similar name exists
146LL | while_loop;
157 | ^^^^^^^^^^ not found in this scope
168
179error[E0425]: cannot find value `while_let` in this scope
18- --> $DIR/label_misspelled.rs:11 :9
10+ --> $DIR/label_misspelled.rs:7 :9
1911 |
2012LL | 'while_let: while let Some(_) = Some(()) {
2113 | ---------- a label with a similar name exists
2214LL | while_let;
2315 | ^^^^^^^^^ not found in this scope
2416
2517error[E0425]: cannot find value `for_loop` in this scope
26- --> $DIR/label_misspelled.rs:15 :9
18+ --> $DIR/label_misspelled.rs:11 :9
2719 |
2820LL | 'for_loop: for _ in 0..3 {
2921 | --------- a label with a similar name exists
3022LL | for_loop;
3123 | ^^^^^^^^ not found in this scope
3224
25+ error[E0425]: cannot find value `LOOP` in this scope
26+ --> $DIR/label_misspelled.rs:15:9
27+ |
28+ LL | 'LOOP: loop {
29+ | ----- a label with a similar name exists
30+ LL | LOOP;
31+ | ^^^^ not found in this scope
32+
3333error[E0425]: cannot find value `LOOP` in this scope
3434 --> $DIR/label_misspelled.rs:22:15
3535 |
@@ -53,7 +53,7 @@ LL | break while_loop;
5353 | help: use the similarly named label: `'while_loop`
5454
5555error[E0425]: cannot find value `while_let` in this scope
56- --> $DIR/label_misspelled.rs:31 :15
56+ --> $DIR/label_misspelled.rs:30 :15
5757 |
5858LL | 'while_let: while let Some(_) = Some(()) {
5959 | ---------- a label with a similar name exists
@@ -64,7 +64,7 @@ LL | break while_let;
6464 | help: use the similarly named label: `'while_let`
6565
6666error[E0425]: cannot find value `for_loop` in this scope
67- --> $DIR/label_misspelled.rs:36 :15
67+ --> $DIR/label_misspelled.rs:34 :15
6868 |
6969LL | 'for_loop: for _ in 0..3 {
7070 | --------- a label with a similar name exists
@@ -75,7 +75,7 @@ LL | break for_loop;
7575 | help: use the similarly named label: `'for_loop`
7676
7777warning: denote infinite loops with `loop { ... }`
78- --> $DIR/label_misspelled.rs:6 :5
78+ --> $DIR/label_misspelled.rs:2 :5
7979 |
8080LL | 'while_loop: while true {
8181 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
@@ -88,40 +88,64 @@ warning: denote infinite loops with `loop { ... }`
8888LL | 'while_loop: while true {
8989 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
9090
91+ warning: denote infinite loops with `loop { ... }`
92+ --> $DIR/label_misspelled.rs:41:5
93+ |
94+ LL | 'while_loop: while true {
95+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
96+
9197error[E0571]: `break` with value from a `while` loop
92- --> $DIR/label_misspelled.rs:26 :9
98+ --> $DIR/label_misspelled.rs:42 :9
9399 |
94- LL | break while_loop;
95- | ^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
100+ LL | 'while_loop: while true {
101+ | ----------------------- you can't `break` with a value in a `while` loop
102+ LL | break foo;
103+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
96104 |
97- help: instead, use `break` on its own without a value inside this `while` loop
105+ help: use `break` on its own without a value inside this `while` loop
98106 |
99107LL | break;
100108 | ^^^^^
109+ help: alternatively, you might have meant to use the available loop label
110+ |
111+ LL | break 'while_loop;
112+ | ^^^^^^^^^^^
101113
102114error[E0571]: `break` with value from a `while` loop
103- --> $DIR/label_misspelled.rs:31 :9
115+ --> $DIR/label_misspelled.rs:46 :9
104116 |
105- LL | break while_let;
106- | ^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
117+ LL | 'while_let: while let Some(_) = Some(()) {
118+ | ---------------------------------------- you can't `break` with a value in a `while` loop
119+ LL | break foo;
120+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
107121 |
108- help: instead, use `break` on its own without a value inside this `while` loop
122+ help: use `break` on its own without a value inside this `while` loop
109123 |
110124LL | break;
111125 | ^^^^^
126+ help: alternatively, you might have meant to use the available loop label
127+ |
128+ LL | break 'while_let;
129+ | ^^^^^^^^^^
112130
113131error[E0571]: `break` with value from a `for` loop
114- --> $DIR/label_misspelled.rs:36 :9
132+ --> $DIR/label_misspelled.rs:50 :9
115133 |
116- LL | break for_loop;
117- | ^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
134+ LL | 'for_loop: for _ in 0..3 {
135+ | ------------------------ you can't `break` with a value in a `for` loop
136+ LL | break foo;
137+ | ^^^^^^^^^ can only break with a value inside `loop` or breakable block
118138 |
119- help: instead, use `break` on its own without a value inside this `for` loop
139+ help: use `break` on its own without a value inside this `for` loop
120140 |
121141LL | break;
122142 | ^^^^^
143+ help: alternatively, you might have meant to use the available loop label
144+ |
145+ LL | break 'for_loop;
146+ | ^^^^^^^^^
123147
124- error: aborting due to 11 previous errors; 2 warnings emitted
148+ error: aborting due to 11 previous errors; 3 warnings emitted
125149
126150Some errors have detailed explanations: E0425, E0571.
127151For more information about an error, try `rustc --explain E0425`.
0 commit comments