]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-53568.rs
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
[rust.git] / src / test / ui / issues / issue-53568.rs
1 // Regression test for an NLL-related ICE (#53568) -- we failed to
2 // resolve inference variables in "custom type-ops".
3 //
4 // check-pass
5
6 trait Future {
7     type Item;
8 }
9
10 impl<F, T> Future for F
11 where F: Fn() -> T
12 {
13     type Item = T;
14 }
15
16 trait Connect {}
17
18 struct Connector<H> {
19     handler: H,
20 }
21
22 impl<H, T> Connect for Connector<H>
23 where
24     T: 'static,
25     H: Future<Item = T>
26 {
27 }
28
29 struct Client<C> {
30     connector: C,
31 }
32
33 fn build<C>(_connector: C) -> Client<C> {
34     unimplemented!()
35 }
36
37 fn client<H>(handler: H) -> Client<impl Connect>
38 where H: Fn() + Copy
39 {
40     let connector = Connector {
41         handler,
42     };
43     let client = build(connector);
44     client
45 }
46
47 fn main() { }