@@ -737,10 +737,9 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
737737 }
738738 }
739739 }
740- ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
741- if self . tcx ( ) . lazy_normalization ( ) =>
742- {
743- assert_eq ! ( promoted, None ) ;
740+ ty:: ConstKind :: Unevaluated ( uv) if self . tcx ( ) . lazy_normalization ( ) => {
741+ assert_eq ! ( uv. promoted, None ) ;
742+ let substs = uv. substs ( self . tcx ( ) ) ;
744743 let substs = self . relate_with_variance (
745744 ty:: Variance :: Invariant ,
746745 ty:: VarianceDiagInfo :: default ( ) ,
@@ -749,7 +748,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
749748 ) ?;
750749 Ok ( self . tcx ( ) . mk_const ( ty:: Const {
751750 ty : c. ty ,
752- val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } ) ,
751+ val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated :: new ( uv . def , substs) ) ,
753752 } ) )
754753 }
755754 _ => relate:: super_relate_consts ( self , c, c) ,
@@ -971,10 +970,9 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
971970 }
972971 }
973972 }
974- ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
975- if self . tcx ( ) . lazy_normalization ( ) =>
976- {
977- assert_eq ! ( promoted, None ) ;
973+ ty:: ConstKind :: Unevaluated ( uv) if self . tcx ( ) . lazy_normalization ( ) => {
974+ assert_eq ! ( uv. promoted, None ) ;
975+ let substs = uv. substs ( self . tcx ( ) ) ;
978976 let substs = self . relate_with_variance (
979977 ty:: Variance :: Invariant ,
980978 ty:: VarianceDiagInfo :: default ( ) ,
@@ -983,7 +981,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
983981 ) ?;
984982 Ok ( self . tcx ( ) . mk_const ( ty:: Const {
985983 ty : c. ty ,
986- val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } ) ,
984+ val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated :: new ( uv . def , substs) ) ,
987985 } ) )
988986 }
989987 _ => relate:: super_relate_consts ( self , c, c) ,
0 commit comments