2023-02-23 13:12:01 -06:00
|
|
|
fn main() {
|
|
|
|
let Some(1) = loop {
|
|
|
|
//~^ NOTE `else` is attached to this loop
|
2024-02-01 16:45:00 -06:00
|
|
|
//~| ERROR refutable pattern in local binding
|
|
|
|
//~| NOTE not covered
|
|
|
|
//~| NOTE for more information
|
|
|
|
//~| NOTE matched value is of type
|
|
|
|
//~| NOTE require an "irrefutable pattern"
|
2023-02-23 13:12:01 -06:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|