rustc_span: avoid hashing ExpnId tag when using cached hash
This commit is contained in:
parent
0dce3f606e
commit
a3623e0542
1 changed files with 1 additions and 2 deletions
|
@ -1925,9 +1925,7 @@ impl<CTX: HashStableContext> HashStable<CTX> for ExpnId {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TAG_NOT_ROOT.hash_stable(ctx, hasher);
|
|
||||||
let index = self.as_u32() as usize;
|
let index = self.as_u32() as usize;
|
||||||
|
|
||||||
let res = CACHE.with(|cache| cache.borrow().get(index).copied().flatten());
|
let res = CACHE.with(|cache| cache.borrow().get(index).copied().flatten());
|
||||||
|
|
||||||
if let Some(res) = res {
|
if let Some(res) = res {
|
||||||
|
@ -1936,6 +1934,7 @@ impl<CTX: HashStableContext> HashStable<CTX> for ExpnId {
|
||||||
let new_len = index + 1;
|
let new_len = index + 1;
|
||||||
|
|
||||||
let mut sub_hasher = StableHasher::new();
|
let mut sub_hasher = StableHasher::new();
|
||||||
|
TAG_NOT_ROOT.hash_stable(ctx, &mut sub_hasher);
|
||||||
self.expn_data().hash_stable(ctx, &mut sub_hasher);
|
self.expn_data().hash_stable(ctx, &mut sub_hasher);
|
||||||
let sub_hash: Fingerprint = sub_hasher.finish();
|
let sub_hash: Fingerprint = sub_hasher.finish();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue