We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cff1d0 commit 78a3131Copy full SHA for 78a3131
src/type_of.rs
@@ -251,7 +251,9 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
251
ty::Ref(..) | ty::RawPtr(_) => {
252
return self.field(cx, index).gcc_type(cx, true);
253
}
254
- ty::Adt(def, _) if def.is_box() => {
+ // only wide pointer boxes are handled as pointers
255
+ // thin pointer boxes with scalar allocators are handled by the general logic below
256
+ ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
257
let ptr_ty = cx.tcx.mk_mut_ptr(self.ty.boxed_ty());
258
return cx.layout_of(ptr_ty).scalar_pair_element_gcc_type(cx, index, immediate);
259
0 commit comments