#[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)]