rust/tests/ui/async-await/async-closures/foreign.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
368 B
Rust
Raw Normal View History

//@ 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()) {
f().await;
}
fn main() {
block_on::block_on(async {
foreign::closure()().await;
call_once(foreign::closure()).await;
});
}