]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0695.md
Rollup merge of #66576 - pnkfelix:more-robust-gdb-vec-printer, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0695.md
1 A `break` statement without a label appeared inside a labeled block.
2
3 Example of erroneous code:
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 ```