Skip to content

Commit ece64ed

Browse files
committed
check the the right field
1 parent e9f08e7 commit ece64ed

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+1
-1
lines changed

compiler/rustc_codegen_ssa/src/mir/place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
455455
cg_base = match elem.clone() {
456456
mir::ProjectionElem::Deref => {
457457
// a box with a non-zst allocator should not be directly dereferenced
458-
if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 0).is_zst() {
458+
if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 1).is_zst() {
459459
let ptr = cg_base.project_field(bx, 0).project_field(bx, 0);
460460

461461
bx.load_operand(ptr).deref(bx.cx())

0 commit comments

Comments
 (0)