@@ -176,15 +176,14 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
176176
177177 return_if_di_node_created_in_meantime ! ( cx, unique_type_id) ;
178178
179- let ( thin_pointer_size, thin_pointer_align) =
180- cx. size_and_align_of ( cx. tcx . mk_imm_ptr ( cx. tcx . types . unit ) ) ;
179+ let data_layout = & cx. tcx . data_layout ;
181180 let ptr_type_debuginfo_name = compute_debuginfo_type_name ( cx. tcx , ptr_type, true ) ;
182181
183182 match fat_pointer_kind ( cx, pointee_type) {
184183 None => {
185184 // This is a thin pointer. Create a regular pointer type and give it the correct name.
186185 debug_assert_eq ! (
187- ( thin_pointer_size , thin_pointer_align ) ,
186+ ( data_layout . pointer_size , data_layout . pointer_align . abi ) ,
188187 cx. size_and_align_of( ptr_type) ,
189188 "ptr_type={}, pointee_type={}" ,
190189 ptr_type,
@@ -195,8 +194,8 @@ fn build_pointer_or_reference_di_node<'ll, 'tcx>(
195194 llvm:: LLVMRustDIBuilderCreatePointerType (
196195 DIB ( cx) ,
197196 pointee_type_di_node,
198- thin_pointer_size . bits ( ) ,
199- thin_pointer_align . bits ( ) as u32 ,
197+ data_layout . pointer_size . bits ( ) ,
198+ data_layout . pointer_align . abi . bits ( ) as u32 ,
200199 0 , // Ignore DWARF address space.
201200 ptr_type_debuginfo_name. as_ptr ( ) . cast ( ) ,
202201 ptr_type_debuginfo_name. len ( ) ,
0 commit comments