Skip to content

Commit 7667b28

Browse files
committed
fixup! debuginfo for FRTs
1 parent 6a3b839 commit 7667b28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ pub(crate) fn spanned_type_di_node<'ll, 'tcx>(
454454
ty::RawPtr(pointee_type, _) | ty::Ref(_, pointee_type, _) => {
455455
build_pointer_or_reference_di_node(cx, t, pointee_type, unique_type_id)
456456
}
457+
// Some `Box` are newtyped pointers, make debuginfo aware of that.
458+
// Only works if the allocator argument is a 1-ZST and hence irrelevant for layout
459+
// (or if there is no allocator argument).
457460
ty::Adt(def, args)
458461
if def.is_box()
459462
&& args.get(1).is_none_or(|arg| cx.layout_of(arg.expect_ty()).is_1zst()) =>

0 commit comments

Comments
 (0)