| error[E0308]: mismatched types | |
| --> $DIR/break-while-condition.rs:8:13 | |
| | | |
| LL | let _: ! = { | |
| | - expected due to this | |
| LL | 'a: while break 'a {} | |
| | ^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `()` | |
| | | |
| = note: expected type `!` | |
| found unit type `()` | |
| = note: `while` loops evaluate to unit type `()` | |
| help: consider adding a diverging expression here | |
| | | |
| LL | 'a: while break 'a {} /* `loop {}` or `panic!("...")` */ | |
| | ++++++++++++++++++++++++++++++++++ | |
| error[E0308]: mismatched types | |
| --> $DIR/break-while-condition.rs:15:13 | |
| | | |
| LL | let _: ! = { | |
| | - expected due to this | |
| LL | / while false { | |
| LL | | | |
| LL | | break; | |
| LL | | } | |
| | |_____________^ expected `!`, found `()` | |
| | | |
| = note: expected type `!` | |
| found unit type `()` | |
| = note: `while` loops evaluate to unit type `()` | |
| help: consider adding a diverging expression here | |
| | | |
| LL ~ } | |
| LL + /* `loop {}` or `panic!("...")` */ | |
| | | |
| error[E0308]: mismatched types | |
| --> $DIR/break-while-condition.rs:24:13 | |
| | | |
| LL | let _: ! = { | |
| | - expected due to this | |
| LL | / while false { | |
| LL | | | |
| LL | | return; | |
| LL | | } | |
| | |_____________^ expected `!`, found `()` | |
| | | |
| = note: expected type `!` | |
| found unit type `()` | |
| = note: `while` loops evaluate to unit type `()` | |
| help: consider adding a diverging expression here | |
| | | |
| LL ~ } | |
| LL + /* `loop {}` or `panic!("...")` */ | |
| | | |
| error: aborting due to 3 previous errors | |
| For more information about this error, try `rustc --explain E0308`. |