1
Fork 0

interpret, codegen: tweak some comments and checks regarding Box with custom allocator

This commit is contained in:
Ralf Jung 2024-08-31 11:29:02 +02:00
parent fa72f0763d
commit d0aedfbb90
4 changed files with 15 additions and 6 deletions

View file

@ -216,6 +216,8 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
// need to make sure that we don't break existing debuginfo consumers
// by doing that (at least not without a warning period).
let layout_type = if ptr_type.is_box() {
// The assertion at the start of this function ensures we have a ZST allocator.
// We'll make debuginfo "skip" all ZST allocators, not just the default allocator.
Ty::new_mut_ptr(cx.tcx, pointee_type)
} else {
ptr_type