mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
27 lines
651 B
Rust
27 lines
651 B
Rust
|
//@ 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
|
||
|
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
|
||
|
}
|