#[inline(always)]
default fn to_fingerprint(&self, tcx: Ctxt) -> Fingerprint {
- let mut hcx = tcx.create_stable_hashing_context();
- let mut hasher = StableHasher::new();
-
- self.hash_stable(&mut hcx, &mut hasher);
-
- hasher.finish()
+ tcx.with_stable_hashing_context(|mut hcx| {
+ let mut hasher = StableHasher::new();
+ self.hash_stable(&mut hcx, &mut hasher);
+ hasher.finish()
+ })
}
#[inline(always)]
impl WorkProductId {
pub fn from_cgu_name(cgu_name: &str) -> WorkProductId {
let mut hasher = StableHasher::new();
- cgu_name.len().hash(&mut hasher);
cgu_name.hash(&mut hasher);
WorkProductId { hash: hasher.finish() }
}