about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/move-out-of-ref.rs
blob: a05447232f62b42f12376d655930416ad4b2013b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ compile-flags: -Zvalidate-mir
//@ edition: 2021

#![feature(async_closure)]

// NOT copy.
struct Ty;

fn hello(x: &Ty) {
    let c = async || {
        *x;
        //~^ ERROR cannot move out of `*x` which is behind a shared reference
    };
}

fn main() {}