Skip to content

Commit 9d63e8c

Browse files
committed
Elaborate ShallowInitBox too.
1 parent 71068af commit 9d63e8c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/base.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,13 +829,6 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
829829
fx.bcx.ins().nop();
830830
}
831831
}
832-
Rvalue::ShallowInitBox(ref operand, content_ty) => {
833-
let content_ty = fx.monomorphize(content_ty);
834-
let box_layout = fx.layout_of(Ty::new_box(fx.tcx, content_ty));
835-
let operand = codegen_operand(fx, operand);
836-
let operand = operand.load_scalar(fx);
837-
lval.write_cvalue(fx, CValue::by_val(operand, box_layout));
838-
}
839832
Rvalue::NullaryOp(ref null_op, ty) => {
840833
assert!(lval.layout().ty.is_sized(fx.tcx, fx.typing_env()));
841834
let layout = fx.layout_of(fx.monomorphize(ty));
@@ -924,6 +917,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
924917
lval.write_cvalue_transmute(fx, operand);
925918
}
926919
Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"),
920+
Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"),
927921
}
928922
}
929923
StatementKind::StorageLive(_)

0 commit comments

Comments
 (0)