1
Fork 0

Make DummyHashStableContext dummier.

This commit is contained in:
Camille GILLOT 2021-06-11 16:53:27 +02:00
parent d1931b6406
commit 72e9589149

View file

@ -1330,12 +1330,12 @@ fn update_disambiguator(expn_id: ExpnId) {
} }
impl<'a> crate::HashStableContext for DummyHashStableContext<'a> { impl<'a> crate::HashStableContext for DummyHashStableContext<'a> {
#[inline]
fn def_path_hash(&self, def_id: DefId) -> DefPathHash { fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
use std::hash::Hasher; DefPathHash(Fingerprint::new(
let mut hasher = StableHasher::new(); def_id.krate.as_u32().into(),
hasher.write_u32(def_id.krate.as_u32()); def_id.index.as_u32().into(),
hasher.write_u32(def_id.index.as_u32()); ))
DefPathHash(hasher.finish())
} }
fn expn_id_cache() -> &'static LocalKey<ExpnIdCache> { fn expn_id_cache() -> &'static LocalKey<ExpnIdCache> {