summaryrefslogtreecommitdiffstats
path: root/tests/ui/loops/loop-else-break-with-value.rs
blob: 670d8a145c0afb3c71da485e68922f4ea1ea19bc (plain)
1
2
3
4
5
6
7
8
9
10
fn main() {
    let Some(1) = loop {
        //~^ NOTE `else` is attached to this loop
        break Some(1)
    } 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
        return;
    };
}