rust/tests/ui/for-loop-while/for-else-let-else-err.rs
reddevilmidzy ab9d0e0ab6 moved tests
updated `tests/ui/README.md`and `src/tools/tidy/src/issues.txt`
2025-12-02 11:13:37 +09:00

8 lines
304 B
Rust

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