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