We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae32f43 commit d0b508eCopy full SHA for d0b508e
compiler/rustc_codegen_llvm/src/type_of.rs
@@ -330,6 +330,8 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyAndLayout<'tcx> {
330
ty::Ref(..) | ty::RawPtr(_) => {
331
return self.field(cx, index).llvm_type(cx);
332
}
333
+ // only wide pointer boxes are handled as pointers
334
+ // thin pointer boxes with scalar allocators are handled by the general logic below
335
ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
336
let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
337
return cx.layout_of(ptr_ty).scalar_pair_element_llvm_type(cx, index, immediate);
0 commit comments