@@ -742,10 +742,9 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
742742 }
743743 }
744744 }
745- ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
746- if self . tcx ( ) . lazy_normalization ( ) =>
747- {
748- assert_eq ! ( promoted, None ) ;
745+ ty:: ConstKind :: Unevaluated ( uv) if self . tcx ( ) . lazy_normalization ( ) => {
746+ assert_eq ! ( uv. promoted, None ) ;
747+ let substs = uv. substs ( self . tcx ( ) ) ;
749748 let substs = self . relate_with_variance (
750749 ty:: Variance :: Invariant ,
751750 ty:: VarianceDiagInfo :: default ( ) ,
@@ -754,7 +753,7 @@ impl TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
754753 ) ?;
755754 Ok ( self . tcx ( ) . mk_const ( ty:: Const {
756755 ty : c. ty ,
757- val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } ) ,
756+ val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated :: new ( uv . def , substs) ) ,
758757 } ) )
759758 }
760759 _ => relate:: super_relate_consts ( self , c, c) ,
@@ -976,10 +975,9 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
976975 }
977976 }
978977 }
979- ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } )
980- if self . tcx ( ) . lazy_normalization ( ) =>
981- {
982- assert_eq ! ( promoted, None ) ;
978+ ty:: ConstKind :: Unevaluated ( uv) if self . tcx ( ) . lazy_normalization ( ) => {
979+ assert_eq ! ( uv. promoted, None ) ;
980+ let substs = uv. substs ( self . tcx ( ) ) ;
983981 let substs = self . relate_with_variance (
984982 ty:: Variance :: Invariant ,
985983 ty:: VarianceDiagInfo :: default ( ) ,
@@ -988,7 +986,7 @@ impl TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
988986 ) ?;
989987 Ok ( self . tcx ( ) . mk_const ( ty:: Const {
990988 ty : c. ty ,
991- val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated { def, substs, promoted } ) ,
989+ val : ty:: ConstKind :: Unevaluated ( ty:: Unevaluated :: new ( uv . def , substs) ) ,
992990 } ) )
993991 }
994992 _ => relate:: super_relate_consts ( self , c, c) ,
0 commit comments