about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-27 10:44:27 +0000
committerbors <bors@rust-lang.org>2023-03-27 10:44:27 +0000
commit553ecbe8bae12bc43a34ac0b8a63e17026ce1e8a (patch)
treea6f0f5595f20fea86645f5d4cb75a91722ff5578 /compiler/rustc_codegen_llvm/src
parent7a0600714ab1a4cb2d1a88cd0660b9f9a2c07309 (diff)
parent6535e66fa545acaa3c0fe015b83a2e502c10119a (diff)
downloadrust-553ecbe8bae12bc43a34ac0b8a63e17026ce1e8a.tar.gz
rust-553ecbe8bae12bc43a34ac0b8a63e17026ce1e8a.zip
Auto merge of #109652 - matthiaskrgr:rollup-pbw3hi3, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #97506 (Stabilize `nonnull_slice_from_raw_parts`)
 - #98651 (Follow C-RW-VALUE in std::io::Cursor example)
 - #102742 (Remove unnecessary raw pointer in __rust_start_panic arg)
 - #109587 (Use an IndexVec to debug fingerprints.)
 - #109613 (fix type suggestions in match arms)
 - #109633 (Fix "Directly go to item in search if there is only one result" setting)
 - #109635 (debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of)
 - #109641 (Don't elaborate non-obligations into obligations)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index c1b3f34e5a6..e2a592d851a 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -176,15 +176,14 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
 
     return_if_di_node_created_in_meantime!(cx, unique_type_id);
 
-    let (thin_pointer_size, thin_pointer_align) =
-        cx.size_and_align_of(cx.tcx.mk_imm_ptr(cx.tcx.types.unit));
+    let data_layout = &cx.tcx.data_layout;
     let ptr_type_debuginfo_name = compute_debuginfo_type_name(cx.tcx, ptr_type, true);
 
     match fat_pointer_kind(cx, pointee_type) {
         None => {
             // This is a thin pointer. Create a regular pointer type and give it the correct name.
             debug_assert_eq!(
-                (thin_pointer_size, thin_pointer_align),
+                (data_layout.pointer_size, data_layout.pointer_align.abi),
                 cx.size_and_align_of(ptr_type),
                 "ptr_type={}, pointee_type={}",
                 ptr_type,
@@ -195,8 +194,8 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
                 llvm::LLVMRustDIBuilderCreatePointerType(
                     DIB(cx),
                     pointee_type_di_node,
-                    thin_pointer_size.bits(),
-                    thin_pointer_align.bits() as u32,
+                    data_layout.pointer_size.bits(),
+                    data_layout.pointer_align.abi.bits() as u32,
                     0, // Ignore DWARF address space.
                     ptr_type_debuginfo_name.as_ptr().cast(),
                     ptr_type_debuginfo_name.len(),