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