summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0695.md
blob: 577f42ef3017c81f071bdd6fa9ca0697ab9241b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
A `break` statement without a label appeared inside a labeled block.

Erroneous code example:

```compile_fail,E0695
loop {
    'a: {
        break;
    }
}
```

Make sure to always label the `break`:

```
'l: loop {
    'a: {
        break 'l;
    }
}
```

Or if you want to `break` the labeled block:

```
loop {
    'a: {
        break 'a;
    }
    break;
}
```