5 fn cond() -> bool { true }
7 fn foo<F>(_: F) where F: FnOnce() {}
10 let pth = break; //~ ERROR: `break` outside of a loop
11 if cond() { continue } //~ ERROR: `continue` outside of a loop
15 if cond() { continue }
17 if cond() { break } //~ ERROR: `break` inside of a closure
18 if cond() { continue } //~ ERROR: `continue` inside of a closure
22 let rs: Foo = Foo{t: pth};
24 let unconstrained = break; //~ ERROR: `break` outside of a loop
26 // This used to ICE because `target_id` passed to `check_expr_break` would be the closure and
27 // not the `loop`, which failed in the call to `find_breakable`. (#65383)
30 break 'lab; //~ ERROR `break` inside of a closure