about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/move-consuming-capture.rs
blob: c833bc7e895954b5e66048790a9cc51c12d8ca41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ aux-build:block-on.rs
//@ edition:2021

extern crate block_on;

struct NoCopy;

fn main() {
    block_on::block_on(async {
        let s = NoCopy;
        let x = async move || {
            drop(s);
        };
        x().await;
        x().await;
        //~^ ERROR use of moved value: `x`
    });
}