Files
rust/src/test/ui/async-await/issues/issue-72312.rs

20 lines
543 B
Rust
Raw Normal View History

// edition:2018
fn require_static<T: 'static>(val: T) -> T {
2021-10-11 19:20:13 +00:00
//~^ NOTE 'static` lifetime requirement introduced by this bound
val
}
struct Problem;
impl Problem {
pub async fn start(&self) { //~ ERROR E0759
//~^ NOTE this data with an anonymous lifetime `'_`
//~| NOTE in this expansion of desugaring of `async` block or function
2021-10-11 19:20:13 +00:00
require_static(async move { //~ NOTE ...and is required to live as long as `'static` here
&self; //~ NOTE ...is captured here...
});
}
}
fn main() {}