]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-53568.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[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 // compile-pass
5
6 #![feature(nll)]
7 #![allow(dead_code)]
8
9 trait Future {
10     type Item;
11 }
12
13 impl<F, T> Future for F
14 where F: Fn() -> T
15 {
16     type Item = T;
17 }
18
19 trait Connect {}
20
21 struct Connector<H> {
22     handler: H,
23 }
24
25 impl<H, T> Connect for Connector<H>
26 where
27     T: 'static,
28     H: Future<Item = T>
29 {
30 }
31
32 struct Client<C> {
33     connector: C,
34 }
35
36 fn build<C>(_connector: C) -> Client<C> {
37     unimplemented!()
38 }
39
40 fn client<H>(handler: H) -> Client<impl Connect>
41 where H: Fn() + Copy
42 {
43     let connector = Connector {
44         handler,
45     };
46     let client = build(connector);
47     client
48 }
49
50 fn main() { }
51