]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0268.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0268.md
1 A loop keyword (`break` or `continue`) was used outside of a loop.
2
3 Erroneous code example:
4
5 ```compile_fail,E0268
6 fn some_func() {
7 break; // error: `break` outside of a loop
8 }
9 ```
10
11 Without a loop to break out of or continue in, no sensible action can be taken.
12 Please verify that you are using `break` and `continue` only in loops. Example:
13
14 ```
15 fn some_func() {
16 for _ in 0..10 {
17 break; // ok!
18 }
19 }
20 ```