Skip to content

Commit ae8c473

Browse files
committed
Give an AllocId to ConstValue::Slice.
1 parent 7fa8429 commit ae8c473

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/constant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ pub(crate) fn codegen_const_value<'tcx>(
210210
.offset_i64(fx, i64::try_from(offset.bytes()).unwrap()),
211211
layout,
212212
),
213-
ConstValue::Slice { data, meta } => {
214-
let alloc_id = fx.tcx.reserve_and_set_memory_alloc(data);
213+
ConstValue::Slice { alloc_id, meta, phantom: _ } => {
215214
let ptr = pointer_for_allocation(fx, alloc_id).get_addr(fx);
216215
let len = fx.bcx.ins().iconst(fx.pointer_type, meta as i64);
217216
CValue::by_val_pair(ptr, len, layout)

0 commit comments

Comments
 (0)