rust/tests/ui/borrowck/erase-error-in-mir-drop-tracking.rs
2023-05-14 23:22:30 +00:00

24 lines
460 B
Rust

// compile-flags: -Zdrop-tracking-mir
// edition:2021
use std::future::Future;
trait Client {
type Connecting<'a>: Future + Send
where
Self: 'a;
fn connect(&'_ self) -> Self::Connecting<'a>;
//~^ ERROR use of undeclared lifetime name `'a`
}
fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
where
C: Client + Send + Sync,
{
async move { c.connect().await }
//~^ ERROR `C` does not live long enough
}
fn main() {}