Skip to content

Commit 3164a47

Browse files
authored
Rollup merge of #122855 - workingjubilee:mangle-64-bit-chauvinism, r=compiler-errors
Fix Itanium mangling usizes Arrays, surprisingly, are not sized to u64 on all platforms. Fixes #122851. r? ```@compiler-errors``` cc ```@maurer```
2 parents b317cda + 861e470 commit 3164a47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: 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)