@@ -500,7 +500,7 @@ struct Generalizer<'cx, 'tcx> {
500
500
501
501
param_env : ty:: ParamEnv < ' tcx > ,
502
502
503
- cache : MiniMap < ( Ty < ' tcx > , Ty < ' tcx > ) , RelateResult < ' tcx , Ty < ' tcx > > > ,
503
+ cache : MiniMap < Ty < ' tcx > , RelateResult < ' tcx , Ty < ' tcx > > > ,
504
504
}
505
505
506
506
/// Result from a generalization operation. This includes
@@ -598,8 +598,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
598
598
fn tys ( & mut self , t : Ty < ' tcx > , t2 : Ty < ' tcx > ) -> RelateResult < ' tcx , Ty < ' tcx > > {
599
599
assert_eq ! ( t, t2) ; // we are abusing TypeRelation here; both LHS and RHS ought to be ==
600
600
601
- let cache_key = ( t, t2) ;
602
- if let Some ( result) = self . cache . get ( & cache_key) {
601
+ if let Some ( result) = self . cache . get ( & t) {
603
602
return result. clone ( ) ;
604
603
}
605
604
debug ! ( "generalize: t={:?}" , t) ;
@@ -667,7 +666,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
667
666
_ => relate:: super_relate_tys ( self , t, t) ,
668
667
} ;
669
668
670
- self . cache . insert ( cache_key , result. clone ( ) ) ;
669
+ self . cache . insert ( t , result. clone ( ) ) ;
671
670
return result;
672
671
}
673
672
0 commit comments