1 A `break` statement with an argument appeared in a non-`loop` loop.
3 Example of erroneous code:
7 # fn satisfied(n: usize) -> bool { n % 23 == 0 }
8 let result = while true {
10 break 2*i; // error: `break` with value from a `while` loop
16 The `break` statement can take an argument (which will be the value of the loop
17 expression if the `break` statement is executed) in `loop` loops, but not
18 `for`, `while`, or `while let` loops.
20 Make sure `break value;` statements only occur in `loop` loops:
24 # fn satisfied(n: usize) -> bool { n % 23 == 0 }
25 let result = loop { // ok!