blob: ae8a10a530ae3035a9f56d4dea27d0018dcb44a1 [file] [log] [blame]
//@ aux-build:block-on.rs
//@ edition:2021
//@ build-pass
extern crate block_on;
struct NoCopy;
fn main() {
block_on::block_on(async {
async fn call_once(x: impl AsyncFn()) { x().await }
// check that `&{async-closure}` implements `AsyncFn`.
call_once(&async || {}).await;
// check that `&{closure}` implements `AsyncFn`.
call_once(&|| async {}).await;
// check that `&fndef` implements `AsyncFn`.
async fn foo() {}
call_once(&foo).await;
});
}