2024-02-16 20:02:50 +00:00
|
|
|
//@ edition:2018
|
2021-10-10 10:37:57 +00:00
|
|
|
fn require_static<T: 'static>(val: T) -> T {
|
|
|
|
|
val
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct Problem;
|
|
|
|
|
|
|
|
|
|
impl Problem {
|
2022-05-21 15:46:25 -04:00
|
|
|
pub async fn start(&self) {
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ NOTE let's call
|
|
|
|
|
//~| NOTE `self` is a reference
|
2022-05-21 15:46:25 -04:00
|
|
|
require_static(async move {
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR borrowed data escapes
|
|
|
|
|
//~| NOTE `self` escapes
|
|
|
|
|
//~| NOTE argument requires
|
|
|
|
|
&self;
|
2021-10-10 10:37:57 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|