cb541dc12c
This commit modifies resolve to disallow `break`/`continue` to labels through closures or async blocks. This doesn't make sense and should have been prohibited anyway. Signed-off-by: David Wood <david@davidtw.co>
13 lines
387 B
Rust
13 lines
387 B
Rust
#![feature(label_break_value)]
|
|
|
|
fn main() {
|
|
// This used to ICE during liveness check because `target_id` passed to
|
|
// `propagate_through_expr` would be the closure and not the `loop`, which wouldn't be found in
|
|
// `self.break_ln`. (#62480)
|
|
'a: {
|
|
|| break 'a
|
|
//~^ ERROR use of unreachable label `'a`
|
|
//~| ERROR `break` inside of a closure
|
|
}
|
|
}
|