rust/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs

18 lines
328 B
Rust

//@ aux-build:block-on.rs
//@ edition:2021
//@ build-pass
#![feature(async_closure)]
extern crate block_on;
fn wrapper(f: impl Fn(String)) -> impl async Fn(String) {
async move |s| f(s)
}
fn main() {
block_on::block_on(async {
wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await;
});
}