@@ -543,10 +543,6 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
543543 true
544544 }
545545
546- fn visit_ct_substs ( & self ) -> bool {
547- true
548- }
549-
550546 fn binders < T > (
551547 & mut self ,
552548 a : ty:: Binder < T > ,
@@ -737,6 +733,16 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
737733 }
738734 }
739735 }
736+ ty:: ConstKind :: Unevaluated ( def, substs, promoted)
737+ if self . tcx ( ) . lazy_normalization ( ) =>
738+ {
739+ assert_eq ! ( promoted, None ) ;
740+ let substs = self . relate_with_variance ( ty:: Variance :: Invariant , substs, substs) ?;
741+ Ok ( self . tcx ( ) . mk_const ( ty:: Const {
742+ ty : c. ty ,
743+ val : ty:: ConstKind :: Unevaluated ( def, substs, promoted) ,
744+ } ) )
745+ }
740746 _ => relate:: super_relate_consts ( self , c, c) ,
741747 }
742748 }
@@ -822,10 +828,6 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
822828 true
823829 }
824830
825- fn visit_ct_substs ( & self ) -> bool {
826- true
827- }
828-
829831 fn relate_with_variance < T : Relate < ' tcx > > (
830832 & mut self ,
831833 _variance : ty:: Variance ,
@@ -959,6 +961,16 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
959961 }
960962 }
961963 }
964+ ty:: ConstKind :: Unevaluated ( def, substs, promoted)
965+ if self . tcx ( ) . lazy_normalization ( ) =>
966+ {
967+ assert_eq ! ( promoted, None ) ;
968+ let substs = self . relate_with_variance ( ty:: Variance :: Invariant , substs, substs) ?;
969+ Ok ( self . tcx ( ) . mk_const ( ty:: Const {
970+ ty : c. ty ,
971+ val : ty:: ConstKind :: Unevaluated ( def, substs, promoted) ,
972+ } ) )
973+ }
962974 _ => relate:: super_relate_consts ( self , c, c) ,
963975 }
964976 }
0 commit comments