Skip to content

Commit 861e470

Browse files
Fix Itanium mangling usizes
Arrays, surprisingly, are not sized to u64 on all platforms.
1 parent 7d01878 commit 861e470

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ fn encode_ty<'tcx>(
525525
"{}",
526526
&len.try_to_scalar()
527527
.unwrap()
528-
.to_u64()
529-
.unwrap_or_else(|_| panic!("failed to convert length to u64"))
528+
.to_target_usize(&tcx.data_layout)
529+
.expect("Array lens are defined in usize")
530530
);
531531
s.push_str(&encode_ty(tcx, *ty0, dict, options));
532532
compress(dict, DictKey::Ty(ty, TyQ::None), &mut s);

0 commit comments

Comments
 (0)