rust/tests/ui/while/while-else-err.rs

9 lines
296 B
Rust
Raw Normal View History

2023-02-23 13:12:01 -06:00
fn main() {
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
};
}