diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-09-07 17:30:38 +0200 | 
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-09-19 10:36:36 +0200 | 
| commit | 182ed8544d2f2ecd4690535a7fcdb809d72e4a86 (patch) | |
| tree | 2c46fc81d25448f7b8cad8e429f96029b2541bf0 /compiler/rustc_mir/src/const_eval/eval_queries.rs | |
| parent | 90708c15c45572842f2abd60ce32c672d80bdbf8 (diff) | |
| download | rust-182ed8544d2f2ecd4690535a7fcdb809d72e4a86.tar.gz rust-182ed8544d2f2ecd4690535a7fcdb809d72e4a86.zip | |
Address review comments
Diffstat (limited to 'compiler/rustc_mir/src/const_eval/eval_queries.rs')
| -rw-r--r-- | compiler/rustc_mir/src/const_eval/eval_queries.rs | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/compiler/rustc_mir/src/const_eval/eval_queries.rs b/compiler/rustc_mir/src/const_eval/eval_queries.rs index 7dae12cf411..00b675dbc4a 100644 --- a/compiler/rustc_mir/src/const_eval/eval_queries.rs +++ b/compiler/rustc_mir/src/const_eval/eval_queries.rs @@ -2,7 +2,7 @@ use super::{CompileTimeEvalContext, CompileTimeInterpreter, ConstEvalErr, Memory use crate::interpret::eval_nullary_intrinsic; use crate::interpret::{ intern_const_alloc_recursive, Allocation, ConstValue, GlobalId, Immediate, InternKind, - InterpCx, InterpResult, MPlaceTy, MemoryKind, OpTy, RawConst, RefTracking, Scalar, + InterpCx, InterpResult, MPlaceTy, MemoryKind, OpTy, ConstAlloc, RefTracking, Scalar, ScalarMaybeUninit, StackPopCleanup, }; @@ -184,9 +184,9 @@ pub(super) fn op_to_const<'tcx>( } } -fn turn_into_const<'tcx>( +fn turn_into_const_value<'tcx>( tcx: TyCtxt<'tcx>, - constant: RawConst<'tcx>, + constant: ConstAlloc<'tcx>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>, ) -> ConstValue<'tcx> { let cid = key.value; @@ -237,7 +237,7 @@ pub fn eval_to_const_value_provider<'tcx>( }); } - tcx.eval_to_allocation_raw(key).map(|val| turn_into_const(tcx, val, key)) + tcx.eval_to_allocation_raw(key).map(|val| turn_into_const_value(tcx, val, key)) } pub fn eval_to_allocation_raw_provider<'tcx>( @@ -402,7 +402,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>( )) } else { // Convert to raw constant - Ok(RawConst { alloc_id: mplace.ptr.assert_ptr().alloc_id, ty: mplace.layout.ty }) + Ok(ConstAlloc { alloc_id: mplace.ptr.assert_ptr().alloc_id, ty: mplace.layout.ty }) } } } | 
