@@ -543,10 +543,6 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
543
543
true
544
544
}
545
545
546
- fn visit_ct_substs ( & self ) -> bool {
547
- true
548
- }
549
-
550
546
fn binders < T > (
551
547
& mut self ,
552
548
a : ty:: Binder < T > ,
@@ -737,6 +733,16 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
737
733
}
738
734
}
739
735
}
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
+ }
740
746
_ => relate:: super_relate_consts ( self , c, c) ,
741
747
}
742
748
}
@@ -822,10 +828,6 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
822
828
true
823
829
}
824
830
825
- fn visit_ct_substs ( & self ) -> bool {
826
- true
827
- }
828
-
829
831
fn relate_with_variance < T : Relate < ' tcx > > (
830
832
& mut self ,
831
833
_variance : ty:: Variance ,
@@ -959,6 +961,16 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
959
961
}
960
962
}
961
963
}
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
+ }
962
974
_ => relate:: super_relate_consts ( self , c, c) ,
963
975
}
964
976
}
0 commit comments