about summary refs log tree commit diff
path: root/tests/ui/loops/loop-else-break-with-value.rs
blob: 7ccf71b2edf4a2a823ff699bd43c870d87816fab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() {
    let Some(1) = loop {
        //~^ NOTE `else` is attached to this loop
        //~| ERROR refutable pattern in local binding
        //~| NOTE not covered
        //~| NOTE for more information
        //~| NOTE matched value is of type
        //~| NOTE require an "irrefutable pattern"
        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;
    };
}