Skip to content

Commit b664b4e

Browse files
committed
Sync from rust b56aaec52bc0fa35591a872fb4aac81f606e265c
2 parents 8483461 + 8390745 commit b664b4e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/constant.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub(crate) fn codegen_tls_ref<'tcx>(
7575
pub(crate) fn eval_mir_constant<'tcx>(
7676
fx: &FunctionCx<'_, '_, 'tcx>,
7777
constant: &ConstOperand<'tcx>,
78-
) -> (ConstValue<'tcx>, Ty<'tcx>) {
78+
) -> (ConstValue, Ty<'tcx>) {
7979
let cv = fx.monomorphize(constant.const_);
8080
// This cannot fail because we checked all required_consts in advance.
8181
let val = cv
@@ -94,7 +94,7 @@ pub(crate) fn codegen_constant_operand<'tcx>(
9494

9595
pub(crate) fn codegen_const_value<'tcx>(
9696
fx: &mut FunctionCx<'_, '_, 'tcx>,
97-
const_val: ConstValue<'tcx>,
97+
const_val: ConstValue,
9898
ty: Ty<'tcx>,
9999
) -> CValue<'tcx> {
100100
let layout = fx.layout_of(ty);
@@ -220,8 +220,7 @@ pub(crate) fn codegen_const_value<'tcx>(
220220
.offset_i64(fx, i64::try_from(offset.bytes()).unwrap()),
221221
layout,
222222
),
223-
ConstValue::Slice { data, meta } => {
224-
let alloc_id = fx.tcx.reserve_and_set_memory_alloc(data);
223+
ConstValue::Slice { alloc_id, meta } => {
225224
let ptr = pointer_for_allocation(fx, alloc_id);
226225
let len = fx.bcx.ins().iconst(fx.pointer_type, meta as i64);
227226
CValue::by_val_pair(ptr, len, layout)

0 commit comments

Comments
 (0)