summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/erase-error-in-mir-drop-tracking.rs
blob: addbe5d658aee5e10fe67db2a75f8a55e99ee5cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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() {}