| warning: denote infinite loops with `loop { ... }` |
| --> $DIR/loop-break-value.rs:24:5 |
| | |
| LL | 'while_loop: while true { |
| | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` |
| | |
| = note: `#[warn(while_true)]` on by default |
| |
| error[E0571]: `break` with value from a `while` loop |
| --> $DIR/loop-break-value.rs:26:9 |
| | |
| LL | break (); |
| | ^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `while` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `while` loop |
| --> $DIR/loop-break-value.rs:28:13 |
| | |
| LL | break 'while_loop 123; |
| | ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `while` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `while` loop |
| --> $DIR/loop-break-value.rs:36:12 |
| | |
| LL | if break () { |
| | ^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `while` loop |
| | |
| LL | if break { |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `while` loop |
| --> $DIR/loop-break-value.rs:41:9 |
| | |
| LL | break None; |
| | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `while` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `while` loop |
| --> $DIR/loop-break-value.rs:47:13 |
| | |
| LL | break 'while_let_loop "nope"; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `while` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `for` loop |
| --> $DIR/loop-break-value.rs:54:9 |
| | |
| LL | break (); |
| | ^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `for` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `for` loop |
| --> $DIR/loop-break-value.rs:55:9 |
| | |
| LL | break [()]; |
| | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `for` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0571]: `break` with value from a `for` loop |
| --> $DIR/loop-break-value.rs:62:13 |
| | |
| LL | break 'for_loop Some(17); |
| | ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block |
| | |
| help: instead, use `break` on its own without a value inside this `for` loop |
| | |
| LL | break; |
| | ^^^^^ |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:2:31 |
| | |
| LL | let val: ! = loop { break break; }; |
| | ^^^^^ expected `!`, found `()` |
| | |
| = note: expected type `!` |
| found unit type `()` |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:9:19 |
| | |
| LL | break 123; |
| | ^^^ expected `&str`, found integer |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:14:15 |
| | |
| LL | break "asdf"; |
| | ^^^^^^ expected `i32`, found `&str` |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:19:31 |
| | |
| LL | break 'outer_loop "nope"; |
| | ^^^^^^ expected `i32`, found `&str` |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:71:26 |
| | |
| LL | break 'c 123; |
| | ^^^ expected `()`, found integer |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:78:15 |
| | |
| LL | break (break, break); |
| | ^^^^^^^^^^^^^^ expected `()`, found tuple |
| | |
| = note: expected unit type `()` |
| found tuple `(!, !)` |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:83:15 |
| | |
| LL | break 2; |
| | ^ expected `()`, found integer |
| |
| error[E0308]: mismatched types |
| --> $DIR/loop-break-value.rs:88:9 |
| | |
| LL | break; |
| | ^^^^^ |
| | | |
| | expected integer, found `()` |
| | help: give it a value of the expected type: `break value` |
| |
| error: aborting due to 16 previous errors |
| |
| Some errors have detailed explanations: E0308, E0571. |
| For more information about an error, try `rustc --explain E0308`. |