diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2023-10-13 20:20:57 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2025-07-23 23:54:37 +0000 |
| commit | 9ff071219bca913e45235568defadd5ab840c50a (patch) | |
| tree | b99f32ff1b7329862353a72f07e382f5fcfb1cac /compiler/rustc_codegen_cranelift | |
| parent | ace633090349fc5075b5b0d56294de985e7d1191 (diff) | |
Give an AllocId to ConstValue::Slice.
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/constant.rs | 3 |
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) |
