diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-06-11 16:53:27 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-06-11 16:54:34 +0200 |
| commit | 72e9589149ce50603afcca03b9ef3bc5475d71da (patch) | |
| tree | b2bd6cde66bf9fbd03970afa5f3547d1899f3be8 /compiler/rustc_span/src | |
| parent | d1931b6406af66520245f1a48de0b79d2d960549 (diff) | |
| download | rust-72e9589149ce50603afcca03b9ef3bc5475d71da.tar.gz rust-72e9589149ce50603afcca03b9ef3bc5475d71da.zip | |
Make DummyHashStableContext dummier.
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/hygiene.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_span/src/hygiene.rs b/compiler/rustc_span/src/hygiene.rs index 3915f7879b7..23efaf6f4f3 100644 --- a/compiler/rustc_span/src/hygiene.rs +++ b/compiler/rustc_span/src/hygiene.rs @@ -1330,12 +1330,12 @@ fn update_disambiguator(expn_id: ExpnId) { } impl<'a> crate::HashStableContext for DummyHashStableContext<'a> { + #[inline] fn def_path_hash(&self, def_id: DefId) -> DefPathHash { - use std::hash::Hasher; - let mut hasher = StableHasher::new(); - hasher.write_u32(def_id.krate.as_u32()); - hasher.write_u32(def_id.index.as_u32()); - DefPathHash(hasher.finish()) + DefPathHash(Fingerprint::new( + def_id.krate.as_u32().into(), + def_id.index.as_u32().into(), + )) } fn expn_id_cache() -> &'static LocalKey<ExpnIdCache> { |
