]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-92096.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-92096.rs
1 // edition:2018
2
3 #![feature(generic_associated_types)]
4
5 use std::future::Future;
6
7 trait Client {
8     type Connecting<'a>: Future + Send
9     where
10         Self: 'a;
11
12     fn connect(&'_ self) -> Self::Connecting<'_>;
13 }
14
15 fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
16 where
17     C: Client + Send + Sync,
18 {
19     async move { c.connect().await }
20     //~^ ERROR `C` does not live long enough
21     //
22     // FIXME(#71723). This is because we infer at some point a value of
23     //
24     // impl Future<Output = <C as Client>::Connection<'_>>
25     //
26     // and then we somehow fail the WF check because `where C: 'a` is not known,
27     // but I'm not entirely sure how that comes about.
28 }
29
30 fn main() {}