about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/const_eval
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-09-11 20:01:48 +0200
committerRalf Jung <post@ralfj.de>2023-09-14 07:26:24 +0200
commit551f481ffb5b510cdb8cdf4d89d71f105b9b29ba (patch)
tree305ce8917c7d6e02ea9ae8e24ca3d8df15e7eea4 /compiler/rustc_const_eval/src/const_eval
parentc728bf3963433062b91bd84ffcb37d15416b800e (diff)
use AllocId instead of Allocation in ConstValue::ByRef
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/eval_queries.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
index 369dc8821d6..7f336daa28a 100644
--- a/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
+++ b/compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -148,10 +148,7 @@ pub(super) fn op_to_const<'tcx>(
     let to_const_value = |mplace: &MPlaceTy<'_>| {
         debug!("to_const_value(mplace: {:?})", mplace);
         match mplace.ptr().into_parts() {
-            (Some(alloc_id), offset) => {
-                let alloc = ecx.tcx.global_alloc(alloc_id).unwrap_memory();
-                ConstValue::ByRef { alloc, offset }
-            }
+            (Some(alloc_id), offset) => ConstValue::ByRef { alloc_id, offset },
             (None, offset) => {
                 assert!(mplace.layout.is_zst());
                 assert_eq!(