rust/tests/ui/loops/loop-else-let-else-err.rs
2023-03-01 13:26:59 +01:00

9 lines
296 B
Rust

fn main() {
let _ = loop {
//~^ NOTE `else` is attached to this loop
} else {
//~^ ERROR `loop...else` loops are not supported
//~| NOTE consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run
};
}