about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-03-26 00:08:51 -0700
committerDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-03-26 00:08:51 -0700
commitece64ed3f56f811f2122dc3dcbff85bf47f8fee3 (patch)
treeff14738ce3f8f89ac0c3fd28bef0f68ac2f5a644 /compiler/rustc_codegen_ssa
parente9f08e709d471988fcf163779dec430cdcbf1193 (diff)
downloadrust-ece64ed3f56f811f2122dc3dcbff85bf47f8fee3.tar.gz
rust-ece64ed3f56f811f2122dc3dcbff85bf47f8fee3.zip
check the the right field
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/place.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/place.rs b/compiler/rustc_codegen_ssa/src/mir/place.rs
index 12cdc2b2c7d..be8b0f3c991 100644
--- a/compiler/rustc_codegen_ssa/src/mir/place.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/place.rs
@@ -455,7 +455,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
             cg_base = match elem.clone() {
                 mir::ProjectionElem::Deref => {
                     // a box with a non-zst allocator should not be directly dereferenced
-                    if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 0).is_zst() {
+                    if cg_base.layout.ty.is_box() && !cg_base.layout.field(cx, 1).is_zst() {
                         let ptr = cg_base.project_field(bx, 0).project_field(bx, 0);
 
                         bx.load_operand(ptr).deref(bx.cx())