summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/issues/issue-72312.rs
blob: 74122cf00a9d490aee6a2efc09b648582bfd802d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// edition:2018
fn require_static<T: 'static>(val: T) -> T {
    val
}

struct Problem;

impl Problem {
    pub async fn start(&self) {
        //~^ NOTE let's call
        //~| NOTE `self` is a reference
        require_static(async move {
            //~^ ERROR borrowed data escapes
            //~| NOTE `self` escapes
            //~| NOTE argument requires
            &self;
        });
    }
}

fn main() {}