@@ -2278,7 +2278,7 @@ impl<'tcx> Const<'tcx> {
22782278 ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) )
22792279 }
22802280 _ => ty:: ConstKind :: Unevaluated (
2281- def. did . to_def_id ( ) ,
2281+ def. to_global ( ) ,
22822282 InternalSubsts :: identity_for_item ( tcx, def. did . to_def_id ( ) ) ,
22832283 None ,
22842284 ) ,
@@ -2347,7 +2347,7 @@ impl<'tcx> Const<'tcx> {
23472347 /// Tries to evaluate the constant if it is `Unevaluated`. If that doesn't succeed, return the
23482348 /// unevaluated constant.
23492349 pub fn eval ( & self , tcx : TyCtxt < ' tcx > , param_env : ParamEnv < ' tcx > ) -> & Const < ' tcx > {
2350- if let ConstKind :: Unevaluated ( did , substs, promoted) = self . val {
2350+ if let ConstKind :: Unevaluated ( def , substs, promoted) = self . val {
23512351 use crate :: mir:: interpret:: ErrorHandled ;
23522352
23532353 let param_env_and_substs = param_env. with_reveal_all ( ) . and ( substs) ;
@@ -2363,7 +2363,7 @@ impl<'tcx> Const<'tcx> {
23632363 // FIXME(eddyb, skinny121) pass `InferCtxt` into here when it's available, so that
23642364 // we can call `infcx.const_eval_resolve` which handles inference variables.
23652365 let param_env_and_substs = if param_env_and_substs. needs_infer ( ) {
2366- tcx. param_env ( did) . and ( InternalSubsts :: identity_for_item ( tcx, did) )
2366+ tcx. param_env ( def . did ) . and ( InternalSubsts :: identity_for_item ( tcx, def . did ) )
23672367 } else {
23682368 param_env_and_substs
23692369 } ;
@@ -2373,7 +2373,7 @@ impl<'tcx> Const<'tcx> {
23732373 let ( param_env, substs) = param_env_and_substs. into_parts ( ) ;
23742374 // try to resolve e.g. associated constants to their definition on an impl, and then
23752375 // evaluate the const.
2376- match tcx. const_eval_resolve ( param_env, did, substs, promoted, None ) {
2376+ match tcx. const_eval_resolve ( param_env, def . did , substs, promoted, None ) {
23772377 // NOTE(eddyb) `val` contains no lifetimes/types/consts,
23782378 // and we use the original type, so nothing from `substs`
23792379 // (which may be identity substs, see above),
@@ -2433,7 +2433,7 @@ pub enum ConstKind<'tcx> {
24332433
24342434 /// Used in the HIR by using `Unevaluated` everywhere and later normalizing to one of the other
24352435 /// variants when the code is monomorphic enough for that.
2436- Unevaluated ( DefId , SubstsRef < ' tcx > , Option < Promoted > ) ,
2436+ Unevaluated ( ty :: WithOptParam < DefId > , SubstsRef < ' tcx > , Option < Promoted > ) ,
24372437
24382438 /// Used to hold computed value.
24392439 Value ( ConstValue < ' tcx > ) ,
0 commit comments