rust/tests/ui/async-await/issues/issue-72312.rs

22 lines
416 B
Rust
Raw Normal View History

// edition:2018
fn require_static<T: 'static>(val: T) -> T {
val
}
struct Problem;
impl Problem {
2022-05-21 14:46:25 -05:00
pub async fn start(&self) {
2022-04-01 12:13:25 -05:00
//~^ NOTE let's call
//~| NOTE `self` is a reference
2022-05-21 14:46:25 -05:00
require_static(async move {
2022-04-01 12:13:25 -05:00
//~^ ERROR borrowed data escapes
//~| NOTE `self` escapes
//~| NOTE argument requires
&self;
});
}
}
fn main() {}