1
Fork 0

Use uplifted rustc-stable-hash crate in rustc_data_structures

This commit is contained in:
Urgau 2024-06-19 21:23:40 +02:00
parent 0c81f94b9a
commit 977439d9b8
11 changed files with 30 additions and 1049 deletions

View file

@ -1,5 +1,5 @@
use crate::stable_hasher::impl_stable_traits_for_trivial_type;
use crate::stable_hasher::{Hash64, StableHasher, StableHasherResult};
use crate::stable_hasher::{FromStableHash, Hash64, StableHasherHash};
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::hash::{Hash, Hasher};
@ -154,10 +154,11 @@ impl FingerprintHasher for crate::unhash::Unhasher {
}
}
impl StableHasherResult for Fingerprint {
impl FromStableHash for Fingerprint {
type Hash = StableHasherHash;
#[inline]
fn finish(hasher: StableHasher) -> Self {
let (_0, _1) = hasher.finalize();
fn from(StableHasherHash([_0, _1]): Self::Hash) -> Self {
Fingerprint(_0, _1)
}
}