File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
src/test/ui/implied-bounds Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ // Taken directly from that issue.
2+ //
3+ // This test detected that we didn't correctly resolve
4+ // inference variables when computing implied bounds.
5+ //
6+ // check-pass
7+ pub trait BuilderFn < ' a > {
8+ type Output ;
9+ }
10+
11+ impl < ' a , F , Out > BuilderFn < ' a > for F
12+ where
13+ F : FnOnce ( & ' a mut ( ) ) -> Out ,
14+ {
15+ type Output = Out ;
16+ }
17+
18+ pub trait ConstructionFirm {
19+ type Builder : for < ' a > BuilderFn < ' a > ;
20+ }
21+
22+ pub trait Campus < T >
23+ where
24+ T : ConstructionFirm ,
25+ {
26+ fn add_building (
27+ & mut self ,
28+ building : & mut <<T as ConstructionFirm >:: Builder as BuilderFn < ' _ > >:: Output ,
29+ ) ;
30+ }
31+
32+ struct ArchitectsInc { }
33+
34+ impl ConstructionFirm for ArchitectsInc {
35+ type Builder = fn ( & mut ( ) ) -> PrettyCondo < ' _ > ;
36+ }
37+
38+ struct PrettyCondo < ' a > {
39+ _marker : & ' a mut ( ) ,
40+ }
41+
42+ struct CondoEstate { }
43+
44+ impl Campus < ArchitectsInc > for CondoEstate {
45+ fn add_building ( & mut self , _building : & mut PrettyCondo < ' _ > ) {
46+ todo ! ( )
47+ }
48+ }
49+
50+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments