rust/tests/ui/for-loop-while/while-else-let-else-err.rs
2025-11-28 21:41:03 +09:00

8 lines
304 B
Rust

fn main() {
let _ = while false {
//~^ NOTE `else` is attached to this loop
} else {
//~^ ERROR `while...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
};
}