about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-10-13 20:20:57 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2025-07-23 23:54:37 +0000
commit9ff071219bca913e45235568defadd5ab840c50a (patch)
treeb99f32ff1b7329862353a72f07e382f5fcfb1cac /compiler/rustc_codegen_cranelift
parentace633090349fc5075b5b0d56294de985e7d1191 (diff)
Give an AllocId to ConstValue::Slice.
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/constant.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/constant.rs b/compiler/rustc_codegen_cranelift/src/constant.rs
index 85adf0f3716..a7e9d7c7bae 100644
--- a/compiler/rustc_codegen_cranelift/src/constant.rs
+++ b/compiler/rustc_codegen_cranelift/src/constant.rs
@@ -210,8 +210,7 @@ pub(crate) fn codegen_const_value<'tcx>(
                 .offset_i64(fx, i64::try_from(offset.bytes()).unwrap()),
             layout,
         ),
-        ConstValue::Slice { data, meta } => {
-            let alloc_id = fx.tcx.reserve_and_set_memory_alloc(data);
+        ConstValue::Slice { alloc_id, meta, phantom: _ } => {
             let ptr = pointer_for_allocation(fx, alloc_id).get_addr(fx);
             let len = fx.bcx.ins().iconst(fx.pointer_type, meta as i64);
             CValue::by_val_pair(ptr, len, layout)