rust/tests/ui/borrowck/erase-error-in-mir-drop-tracking.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
460 B
Rust
Raw Normal View History

2023-05-14 18:22:27 -05:00
// 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() {}