diff options
| author | bors <bors@rust-lang.org> | 2020-10-28 20:03:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-28 20:03:55 +0000 |
| commit | 31ee872db5aae4750e3da1ca4ed1523c4356947f (patch) | |
| tree | 511a0751b47f000d8bcd8109a52749725889f497 /compiler/rustc_span/src/lib.rs | |
| parent | 3dddf6ac1e194deb3d927064e7c6d50bc9325dd0 (diff) | |
| parent | a3623e05429952cd8cbfd875409d3cb7c8f8045d (diff) | |
| download | rust-31ee872db5aae4750e3da1ca4ed1523c4356947f.tar.gz rust-31ee872db5aae4750e3da1ca4ed1523c4356947f.zip | |
Auto merge of #78415 - tgnottingham:expn_id_tag_hash, r=Aaron1011
rustc_span: avoid hashing ExpnId tag when using cached hash
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index 29c686e5d08..79363c3a5ca 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -1925,9 +1925,7 @@ impl<CTX: HashStableContext> HashStable<CTX> for ExpnId { return; } - TAG_NOT_ROOT.hash_stable(ctx, hasher); let index = self.as_u32() as usize; - let res = CACHE.with(|cache| cache.borrow().get(index).copied().flatten()); if let Some(res) = res { @@ -1936,6 +1934,7 @@ impl<CTX: HashStableContext> HashStable<CTX> for ExpnId { let new_len = index + 1; let mut sub_hasher = StableHasher::new(); + TAG_NOT_ROOT.hash_stable(ctx, &mut sub_hasher); self.expn_data().hash_stable(ctx, &mut sub_hasher); let sub_hash: Fingerprint = sub_hasher.finish(); |
