2024-02-10 22:58:23 +00:00
|
|
|
//@ aux-build:block-on.rs
|
|
|
|
//@ aux-build:foreign.rs
|
|
|
|
//@ edition:2021
|
|
|
|
//@ build-pass
|
|
|
|
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
extern crate block_on;
|
|
|
|
extern crate foreign;
|
|
|
|
|
|
|
|
struct NoCopy;
|
|
|
|
|
2024-11-04 18:59:57 +00:00
|
|
|
async fn call_once(f: impl AsyncFnOnce()) {
|
2024-09-10 11:39:46 -04:00
|
|
|
f().await;
|
|
|
|
}
|
|
|
|
|
2024-02-10 22:58:23 +00:00
|
|
|
fn main() {
|
|
|
|
block_on::block_on(async {
|
|
|
|
foreign::closure()().await;
|
2024-09-10 11:39:46 -04:00
|
|
|
call_once(foreign::closure()).await;
|
2024-02-10 22:58:23 +00:00
|
|
|
});
|
|
|
|
}
|