mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
18 lines
322 B
Rust
18 lines
322 B
Rust
//@ aux-build:block-on.rs
|
|
//@ edition: 2021
|
|
//@ build-pass
|
|
//@ compile-flags: -Cdebuginfo=2
|
|
|
|
extern crate block_on;
|
|
|
|
async fn call_once(f: impl AsyncFnOnce()) {
|
|
f().await;
|
|
}
|
|
|
|
pub fn main() {
|
|
block_on::block_on(async {
|
|
let async_closure = async move || {};
|
|
call_once(async_closure).await;
|
|
});
|
|
}
|