2024-05-05 17:39:07 -04:00
|
|
|
//@ edition: 2024
|
|
|
|
//@ compile-flags: -Z unstable-options
|
|
|
|
|
|
|
|
#![feature(gen_blocks)]
|
|
|
|
#![feature(async_closure)]
|
|
|
|
|
|
|
|
async fn async_fn() {
|
|
|
|
break; //~ ERROR `break` inside `async` function
|
|
|
|
}
|
|
|
|
|
|
|
|
gen fn gen_fn() {
|
|
|
|
break; //~ ERROR `break` inside `gen` function
|
|
|
|
}
|
|
|
|
|
|
|
|
async gen fn async_gen_fn() {
|
|
|
|
break; //~ ERROR `break` inside `async gen` function
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _ = async { break; }; //~ ERROR `break` inside `async` block
|
2024-05-13 22:42:18 +08:00
|
|
|
|
2024-05-05 17:39:07 -04:00
|
|
|
let _ = async || { break; }; //~ ERROR `break` inside `async` closure
|
|
|
|
|
|
|
|
let _ = gen { break; }; //~ ERROR `break` inside `gen` block
|
|
|
|
|
|
|
|
let _ = async gen { break; }; //~ ERROR `break` inside `async gen` block
|
|
|
|
}
|