2024-01-25 11:43:35 -06:00
|
|
|
//@ aux-build:block-on.rs
|
|
|
|
//@ edition:2021
|
|
|
|
//@ run-pass
|
|
|
|
|
2024-02-06 11:41:48 -06:00
|
|
|
#![feature(async_closure)]
|
2024-01-25 11:43:35 -06:00
|
|
|
|
|
|
|
extern crate block_on;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
block_on::block_on(async {
|
2024-02-06 11:41:48 -06:00
|
|
|
async fn needs_async_fn_once(x: impl async FnOnce()) {
|
2024-01-25 11:43:35 -06:00
|
|
|
x().await;
|
|
|
|
}
|
2024-02-26 17:06:38 -06:00
|
|
|
|
|
|
|
needs_async_fn_once(async || {}).await;
|
|
|
|
|
|
|
|
needs_async_fn_once(|| async {}).await;
|
|
|
|
|
|
|
|
async fn foo() {}
|
|
|
|
needs_async_fn_once(foo).await;
|
2024-01-25 11:43:35 -06:00
|
|
|
});
|
|
|
|
}
|