]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0695.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0695.md
1 A `break` statement without a label appeared inside a labeled block.
2
3 Erroneous code example:
4
5 ```compile_fail,E0695
6 # #![feature(label_break_value)]
7 loop {
8     'a: {
9         break;
10     }
11 }
12 ```
13
14 Make sure to always label the `break`:
15
16 ```
17 # #![feature(label_break_value)]
18 'l: loop {
19     'a: {
20         break 'l;
21     }
22 }
23 ```
24
25 Or if you want to `break` the labeled block:
26
27 ```
28 # #![feature(label_break_value)]
29 loop {
30     'a: {
31         break 'a;
32     }
33     break;
34 }
35 ```