Sisu
E0038

break or continue outside a loop

Error

Built from the repository at commit a8614dc.

break and continue act on the loop around them: loop, while, or for.

Why

Outside a loop there is nothing to leave or to repeat. To leave a function, use return.

Broken

fn main() {
    break
}

What sisu says

error[E0038]: `break` outside a loop
 --> E0038.sisu:2:5
  |
2 |     break
  |     ^^^^^

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0038

Fixed

fn main() {
    loop {
        break
    }
}