Skip to content

Commit f8c86c8

Browse files
committed
Auto merge of #103231 - ecnelises:le_fix, r=lcnr
Remove byte swap of valtree hash on big endian This addresses problem reported in #103183. The code was originally introduced in e14b34c. (see #96591) On big-endian environment, this operation sequence actually put the other half from 128-bit result, thus we got different hash result on LE and BE.
2 parents 26c96e3 + 7b5a366 commit f8c86c8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,8 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
666666
hcx.while_hashing_spans(false, |hcx| {
667667
ct.to_valtree().hash_stable(hcx, &mut hasher)
668668
});
669-
// Note: Don't use `StableHashResult` impl of `u64` here directly, since that
670-
// would lead to endianness problems.
671-
let hash: u128 = hasher.finish();
672-
(hash.to_le() as u64).to_le()
669+
let hash: u64 = hasher.finish();
670+
hash
673671
});
674672

675673
if cpp_like_debuginfo(tcx) {

0 commit comments

Comments
 (0)