about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-02-15 19:24:12 -0800
committerDrMeepster <19316085+DrMeepster@users.noreply.github.com>2022-02-15 20:04:43 -0800
commitae32f43c50fc72ba2812c18053c34d1b94aa5e3f (patch)
tree8f1840e2cc6f829b89b917fca05851d04a79fd2a /compiler/rustc_codegen_llvm/src
parent393fdc10483da930cdbb00eabc3635030d2e776f (diff)
downloadrust-ae32f43c50fc72ba2812c18053c34d1b94aa5e3f.tar.gz
rust-ae32f43c50fc72ba2812c18053c34d1b94aa5e3f.zip
fix assumption that ScalarPair Box is always a fat pointer
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/type_of.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs
index 81d0603bc52..24e158b489b 100644
--- a/compiler/rustc_codegen_llvm/src/type_of.rs
+++ b/compiler/rustc_codegen_llvm/src/type_of.rs
@@ -330,7 +330,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
             ty::Ref(..) | ty::RawPtr(_) => {
                 return self.field(cx, index).llvm_type(cx);
             }
-            ty::Adt(def, _) if def.is_box() => {
+            ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
                 let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
                 return cx.layout_of(ptr_ty).scalar_pair_element_llvm_type(cx, index, immediate);
             }