@@ -34,6 +34,42 @@ LL | for_loop;
3434 | not found in this scope
3535 | help: a label with a similar name exists: `'for_loop`
3636
37+ error[E0425]: cannot find value `LOOP` in this scope
38+ --> $DIR/label_misspelled.rs:22:15
39+ |
40+ LL | break LOOP;
41+ | ^^^^
42+ | |
43+ | not found in this scope
44+ | help: a label with a similar name exists: `'LOOP`
45+
46+ error[E0425]: cannot find value `while_loop` in this scope
47+ --> $DIR/label_misspelled.rs:26:15
48+ |
49+ LL | break while_loop;
50+ | ^^^^^^^^^^
51+ | |
52+ | not found in this scope
53+ | help: a label with a similar name exists: `'while_loop`
54+
55+ error[E0425]: cannot find value `while_let` in this scope
56+ --> $DIR/label_misspelled.rs:31:15
57+ |
58+ LL | break while_let;
59+ | ^^^^^^^^^
60+ | |
61+ | not found in this scope
62+ | help: a label with a similar name exists: `'while_let`
63+
64+ error[E0425]: cannot find value `for_loop` in this scope
65+ --> $DIR/label_misspelled.rs:36:15
66+ |
67+ LL | break for_loop;
68+ | ^^^^^^^^
69+ | |
70+ | not found in this scope
71+ | help: a label with a similar name exists: `'for_loop`
72+
3773warning: denote infinite loops with `loop { ... }`
3874 --> $DIR/label_misspelled.rs:6:5
3975 |
@@ -42,6 +78,46 @@ LL | 'while_loop: while true {
4278 |
4379 = note: `#[warn(while_true)]` on by default
4480
45- error: aborting due to 4 previous errors; 1 warning emitted
81+ warning: denote infinite loops with `loop { ... }`
82+ --> $DIR/label_misspelled.rs:25:5
83+ |
84+ LL | 'while_loop: while true {
85+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
86+
87+ error[E0571]: `break` with value from a `while` loop
88+ --> $DIR/label_misspelled.rs:26:9
89+ |
90+ LL | break while_loop;
91+ | ^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
92+ |
93+ help: instead, use `break` on its own without a value inside this `while` loop
94+ |
95+ LL | break;
96+ | ^^^^^
97+
98+ error[E0571]: `break` with value from a `while` loop
99+ --> $DIR/label_misspelled.rs:31:9
100+ |
101+ LL | break while_let;
102+ | ^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
103+ |
104+ help: instead, use `break` on its own without a value inside this `while` loop
105+ |
106+ LL | break;
107+ | ^^^^^
108+
109+ error[E0571]: `break` with value from a `for` loop
110+ --> $DIR/label_misspelled.rs:36:9
111+ |
112+ LL | break for_loop;
113+ | ^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
114+ |
115+ help: instead, use `break` on its own without a value inside this `for` loop
116+ |
117+ LL | break;
118+ | ^^^^^
119+
120+ error: aborting due to 11 previous errors; 2 warnings emitted
46121
47- For more information about this error, try `rustc --explain E0425`.
122+ Some errors have detailed explanations: E0425, E0571.
123+ For more information about an error, try `rustc --explain E0425`.
0 commit comments