Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1b34e2d

Browse files
committed
Introduce Rvalue::ShallowInitBox
1 parent 208fc42 commit 1b34e2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/base.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,13 @@ fn codegen_stmt<'tcx>(
701701
let len = codegen_array_len(fx, place);
702702
lval.write_cvalue(fx, CValue::by_val(len, usize_layout));
703703
}
704+
Rvalue::ShallowInitBox(ref operand, content_ty) => {
705+
let content_ty = fx.monomorphize(content_ty);
706+
let box_layout = fx.layout_of(fx.tcx.mk_box(content_ty));
707+
let operand = codegen_operand(fx, operand);
708+
let operand = operand.load_scalar(fx);
709+
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
710+
}
704711
Rvalue::NullaryOp(NullOp::Box, content_ty) => {
705712
let usize_type = fx.clif_type(fx.tcx.types.usize).unwrap();
706713
let content_ty = fx.monomorphize(content_ty);

0 commit comments

Comments
 (0)