about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.rs
blob: 0c22ac97265bb5ba0c4e345701961c4b052a5e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ aux-build:block-on.rs
//@ edition:2021
//@ build-pass

extern crate block_on;

fn wrapper(f: impl Fn(String)) -> impl AsyncFn(String) {
    async move |s| f(s)
}

fn main() {
    block_on::block_on(async {
        wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await;
    });
}