diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-07-12 22:19:25 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-07-06 22:50:55 +0200 |
| commit | 43bb31b9540a439dcca65f47b8644eafe4a42e2d (patch) | |
| tree | 8c707ae5bb7b76fd39b0b0b811e50fd336e5cd17 /compiler/rustc_query_impl/src/on_disk_cache.rs | |
| parent | 3dcb616888aac50d55160b025266d555dad937d9 (diff) | |
| download | rust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.tar.gz rust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.zip | |
Allow to create definitions inside the query system.
Diffstat (limited to 'compiler/rustc_query_impl/src/on_disk_cache.rs')
| -rw-r--r-- | compiler/rustc_query_impl/src/on_disk_cache.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs index b01c512a3b4..4c25075327f 100644 --- a/compiler/rustc_query_impl/src/on_disk_cache.rs +++ b/compiler/rustc_query_impl/src/on_disk_cache.rs @@ -653,12 +653,11 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for ExpnId { #[cfg(debug_assertions)] { use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; - let mut hcx = decoder.tcx.create_stable_hashing_context(); - let mut hasher = StableHasher::new(); - hcx.while_hashing_spans(true, |hcx| { - expn_id.expn_data().hash_stable(hcx, &mut hasher) + let local_hash: u64 = decoder.tcx.with_stable_hashing_context(|mut hcx| { + let mut hasher = StableHasher::new(); + expn_id.expn_data().hash_stable(&mut hcx, &mut hasher); + hasher.finish() }); - let local_hash: u64 = hasher.finish(); debug_assert_eq!(hash.local_hash(), local_hash); } |
