3

Fix ICE when using Box<T, A> with pointer sized A by DrMeepster · Pull Req...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/94043
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

@@ -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() => {

Copy link

Contributor

@oli-obk oli-obk 10 days ago

Please leave a comment here stating that we only handle wide pointer boxes as pointers, not thin pointer boxes with a scalar allocator. That case is handled in the general logic below

DrMeepster reacted with thumbs up emoji

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK