]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0767.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0767.md
1 An unreachable label was used.
2
3 Erroneous code example:
4
5 ```compile_fail,E0767
6 'a: loop {
7     || {
8         loop { break 'a } // error: use of unreachable label `'a`
9     };
10 }
11 ```
12
13 Ensure that the label is within scope. Labels are not reachable through
14 functions, closures, async blocks or modules. Example:
15
16 ```
17 'a: loop {
18     break 'a; // ok!
19 }
20 ```