]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-72312.rs
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-72312.rs
1 // edition:2018
2 fn require_static<T: 'static>(val: T) -> T {
3     val
4 }
5
6 struct Problem;
7
8 impl Problem {
9     pub async fn start(&self) {
10         //~^ NOTE let's call
11         //~| NOTE `self` is a reference
12         require_static(async move {
13             //~^ ERROR borrowed data escapes
14             //~| NOTE `self` escapes
15             //~| NOTE argument requires
16             &self;
17         });
18     }
19 }
20
21 fn main() {}