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```
This commit is contained in:
Matthias Krüger 2024-03-22 11:37:03 +01:00 committed by GitHub
commit 3164a47fcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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