1
Fork 0

Remove byte swap of valtree hash on big endian

This commit is contained in:
Qiu Chaofan 2022-10-19 14:53:47 +08:00
parent 2efc90e738
commit 7b5a366c2a

View file

@ -666,10 +666,8 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
hcx.while_hashing_spans(false, |hcx| { hcx.while_hashing_spans(false, |hcx| {
ct.to_valtree().hash_stable(hcx, &mut hasher) ct.to_valtree().hash_stable(hcx, &mut hasher)
}); });
// Note: Don't use `StableHashResult` impl of `u64` here directly, since that let hash: u64 = hasher.finish();
// would lead to endianness problems. hash
let hash: u128 = hasher.finish();
(hash.to_le() as u64).to_le()
}); });
if cpp_like_debuginfo(tcx) { if cpp_like_debuginfo(tcx) {