diff options
| author | bors <bors@rust-lang.org> | 2022-02-17 22:54:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-02-17 22:54:18 +0000 |
| commit | 73a7423e77b49a99e270531fbadda5b8899df3f6 (patch) | |
| tree | e8710d3ce418b53ef817c313b05d44020e523f14 /compiler/rustc_codegen_llvm/src | |
| parent | 30b3f35c420694a4f24e5a4df00f06073f4f3a37 (diff) | |
| parent | 39c17488fb9daca40f3fa8348409515660c594e4 (diff) | |
| download | rust-73a7423e77b49a99e270531fbadda5b8899df3f6.tar.gz rust-73a7423e77b49a99e270531fbadda5b8899df3f6.zip | |
Auto merge of #94103 - matthiaskrgr:rollup-cd70ofn, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #93337 (Update tracking issue numbers for inline assembly sub-features) - #93758 (Improve comments about type folding/visiting.) - #93780 (Generate list instead of div items in sidebar) - #93976 (Add MAIN_SEPARATOR_STR) - #94011 (Even more let_else adoptions) - #94041 (Add a `try_collect()` helper method to `Iterator`) - #94043 (Fix ICE when using Box<T, A> with pointer sized A) - #94082 (Remove CFG_PLATFORM) - #94085 (Clippy: Don't lint `needless_borrow` in method receiver positions) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/type_of.rs | 4 |
1 files changed, 3 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..fafb9a6dbde 100644 --- a/compiler/rustc_codegen_llvm/src/type_of.rs +++ b/compiler/rustc_codegen_llvm/src/type_of.rs @@ -330,7 +330,9 @@ 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() => { + // only wide pointer boxes are handled as pointers + // thin pointer boxes with scalar allocators are handled by the general logic below + 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); } |
