E0268 - Error codes index
Description: Book listing all Rust error codes

# Error code E0268

A loop keyword (`break` or `continue`) was used outside of a loop.

Erroneous code example:

    #![allow(unused)]
    fn main() {
    fn some_func() {
        break; // error: `break` outside of a loop
    }
    }

Without a loop to break out of or continue in, no sensible action can be taken. Please verify that you are using `break` and `continue` only in loops. Example:

    #![allow(unused)]
    fn main() {
    fn some_func() {
        for _ in 0..10 {
            break; // ok!
        }
    }
    }