diff --git a/src/base.rs b/src/base.rs index fe33a1f9b09..917afa4eae0 100644 --- a/src/base.rs +++ b/src/base.rs @@ -668,7 +668,7 @@ fn codegen_stmt<'tcx>( let times = fx .monomorphize(times) .eval(fx.tcx, ParamEnv::reveal_all()) - .val + .val() .try_to_bits(fx.tcx.data_layout.pointer_size) .unwrap(); if operand.layout().size.bytes() == 0 { diff --git a/src/constant.rs b/src/constant.rs index 9df6c7766c6..274fb211b7b 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -46,7 +46,7 @@ pub(crate) fn check_constants(fx: &mut FunctionCx<'_, '_, '_>) -> bool { ConstantKind::Ty(ct) => ct, ConstantKind::Val(..) => continue, }; - match const_.val { + match const_.val() { ConstKind::Value(_) => {} ConstKind::Unevaluated(unevaluated) => { if let Err(err) = @@ -127,7 +127,7 @@ pub(crate) fn codegen_constant<'tcx>( ConstantKind::Ty(ct) => ct, ConstantKind::Val(val, ty) => return codegen_const_value(fx, val, ty), }; - let const_val = match const_.val { + let const_val = match const_.val() { ConstKind::Value(const_val) => const_val, ConstKind::Unevaluated(ty::Unevaluated { def, substs, promoted }) if fx.tcx.is_static(def.did) => @@ -135,7 +135,7 @@ pub(crate) fn codegen_constant<'tcx>( assert!(substs.is_empty()); assert!(promoted.is_none()); - return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty)).to_cvalue(fx); + return codegen_static_ref(fx, def.did, fx.layout_of(const_.ty())).to_cvalue(fx); } ConstKind::Unevaluated(unevaluated) => { match fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), unevaluated, None) { @@ -152,7 +152,7 @@ pub(crate) fn codegen_constant<'tcx>( | ConstKind::Error(_) => unreachable!("{:?}", const_), }; - codegen_const_value(fx, const_val, const_.ty) + codegen_const_value(fx, const_val, const_.ty()) } pub(crate) fn codegen_const_value<'tcx>( @@ -465,7 +465,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>( match operand { Operand::Constant(const_) => match const_.literal { ConstantKind::Ty(const_) => { - fx.monomorphize(const_).eval(fx.tcx, ParamEnv::reveal_all()).val.try_to_value() + fx.monomorphize(const_).eval(fx.tcx, ParamEnv::reveal_all()).val().try_to_value() } ConstantKind::Val(val, _) => Some(val), },