@@ -15,25 +15,20 @@ use super::Subtype;
1515
1616use ty:: { self , Ty , TyCtxt } ;
1717use ty:: relate:: { Relate , RelateResult , TypeRelation } ;
18- use traits:: PredicateObligations ;
1918
2019/// "Greatest lower bound" (common subtype)
21- pub struct Glb < ' infcx , ' gcx : ' infcx +' tcx , ' tcx : ' infcx > {
22- fields : CombineFields < ' infcx , ' gcx , ' tcx > ,
20+ pub struct Glb < ' combine , ' infcx : ' combine , ' gcx : ' infcx +' tcx , ' tcx : ' infcx > {
21+ fields : & ' combine mut CombineFields < ' infcx , ' gcx , ' tcx > ,
2322 a_is_expected : bool ,
2423}
2524
26- impl < ' infcx , ' gcx , ' tcx > Glb < ' infcx , ' gcx , ' tcx > {
27- pub fn new ( fields : CombineFields < ' infcx , ' gcx , ' tcx > , a_is_expected : bool ) -> Glb < ' infcx , ' gcx , ' tcx > {
25+ impl < ' combine , ' infcx , ' gcx , ' tcx > Glb < ' combine , ' infcx , ' gcx , ' tcx > {
26+ pub fn new ( fields : & ' combine mut CombineFields < ' infcx , ' gcx , ' tcx > , a_is_expected : bool ) -> Glb < ' combine , ' infcx , ' gcx , ' tcx > {
2827 Glb { fields : fields, a_is_expected : a_is_expected }
2928 }
30-
31- pub fn obligations ( self ) -> PredicateObligations < ' tcx > {
32- self . fields . obligations
33- }
3429}
3530
36- impl < ' infcx , ' gcx , ' tcx > TypeRelation < ' infcx , ' gcx , ' tcx > for Glb < ' infcx , ' gcx , ' tcx > {
31+ impl < ' combine , ' infcx , ' gcx , ' tcx > TypeRelation < ' infcx , ' gcx , ' tcx > for Glb < ' combine , ' infcx , ' gcx , ' tcx > {
3732 fn tag ( & self ) -> & ' static str { "Glb" }
3833
3934 fn tcx ( & self ) -> TyCtxt < ' infcx , ' gcx , ' tcx > { self . fields . tcx ( ) }
@@ -76,12 +71,12 @@ impl<'infcx, 'gcx, 'tcx> TypeRelation<'infcx, 'gcx, 'tcx> for Glb<'infcx, 'gcx,
7671 }
7772}
7873
79- impl < ' infcx , ' gcx , ' tcx > LatticeDir < ' infcx , ' gcx , ' tcx > for Glb < ' infcx , ' gcx , ' tcx > {
74+ impl < ' combine , ' infcx , ' gcx , ' tcx > LatticeDir < ' infcx , ' gcx , ' tcx > for Glb < ' combine , ' infcx , ' gcx , ' tcx > {
8075 fn infcx ( & self ) -> & ' infcx InferCtxt < ' infcx , ' gcx , ' tcx > {
8176 self . fields . infcx
8277 }
8378
84- fn relate_bound ( & self , v : Ty < ' tcx > , a : Ty < ' tcx > , b : Ty < ' tcx > ) -> RelateResult < ' tcx , ( ) > {
79+ fn relate_bound ( & mut self , v : Ty < ' tcx > , a : Ty < ' tcx > , b : Ty < ' tcx > ) -> RelateResult < ' tcx , ( ) > {
8580 let mut sub = self . fields . sub ( self . a_is_expected ) ;
8681 sub. relate ( & v, & a) ?;
8782 sub. relate ( & v, & b) ?;
0 commit comments