Skip to content

Commit ae356cb

Browse files
authored
Rollup merge of #147597 - JohnTitor:issue-72207, r=chenyukang
Add a regression test for #72207Closes#72207
2 parents 13ef05d + e0b7b23 commit ae356cb

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//@ check-pass
2+
//@ compile-flags: --crate-type=lib
3+
4+
#![allow(dead_code)]
5+
6+
use std::marker::PhantomData;
7+
8+
pubstructXImpl<T,E,F2,F1>
9+
where
10+
F2:Fn(E),
11+
{
12+
f1:F1,
13+
f2:F2,
14+
_ghost:PhantomData<(T,E)>,
15+
}
16+
17+
pubtraitX<T>:Sized{
18+
typeF1;
19+
typeF2:Fn(Self::E);
20+
typeE;
21+
22+
fnand<NewF1,NewF1Generator>(self,f:NewF1Generator) -> XImpl<T,Self::E,Self::F2,NewF1>
23+
where
24+
NewF1Generator:FnOnce(Self::F1) -> NewF1;
25+
}
26+
27+
impl<T,E,F2,F1>X<T>forXImpl<T,E,F2,F1>
28+
where
29+
F2:Fn(E),
30+
{
31+
typeE = E;
32+
typeF2 = F2;
33+
typeF1 = F1;
34+
35+
fnand<NewF1,NewF1Generator>(self,f:NewF1Generator) -> XImpl<T,E,F2,NewF1>
36+
where
37+
NewF1Generator:FnOnce(F1) -> NewF1,
38+
{
39+
XImpl{
40+
f1:f(self.f1),
41+
f2:self.f2,
42+
_ghost:PhantomData,
43+
}
44+
}
45+
}
46+
47+
fnf() -> implX<(),E = ()>{
48+
XImpl{
49+
f1: || (),
50+
f2: |()| (),
51+
_ghost:PhantomData,
52+
}
53+
}
54+
55+
fnf2() -> implX<(),E = ()>{
56+
f().and(|rb| rb)
57+
}

0 commit comments

Comments
 (0)