diff options
| author | bors <bors@rust-lang.org> | 2022-04-09 02:31:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-04-09 02:31:24 +0000 |
| commit | e980c6295582792e4a7c2d67e33cece60c170115 (patch) | |
| tree | 0e52df53a2dba63646376b4f633f595652d05bd4 /compiler/rustc_query_system | |
| parent | 340f6491bed3525acfabbdbd1545b6aee2fca62b (diff) | |
| parent | 25d6f8e0f647f865775158f35408724278145c50 (diff) | |
| download | rust-e980c6295582792e4a7c2d67e33cece60c170115.tar.gz rust-e980c6295582792e4a7c2d67e33cece60c170115.zip | |
Auto merge of #95524 - oli-obk:cached_stable_hash_cleanups, r=nnethercote
Cached stable hash cleanups r? `@nnethercote` Add a sanity assertion in debug mode to check that the cached hashes are actually the ones we get if we compute the hash each time. Add a new data structure that bundles all the hash-caching work to make it easier to re-use it for different interned data structures
Diffstat (limited to 'compiler/rustc_query_system')
| -rw-r--r-- | compiler/rustc_query_system/src/ich/hcx.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_query_system/src/ich/hcx.rs b/compiler/rustc_query_system/src/ich/hcx.rs index 76e21be17bc..a073bf71057 100644 --- a/compiler/rustc_query_system/src/ich/hcx.rs +++ b/compiler/rustc_query_system/src/ich/hcx.rs @@ -231,4 +231,12 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { } } +impl<'a> rustc_data_structures::intern::InternedHashingContext for StableHashingContext<'a> { + fn with_def_path_and_no_spans(&mut self, f: impl FnOnce(&mut Self)) { + self.while_hashing_spans(false, |hcx| { + hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| f(hcx)) + }); + } +} + impl<'a> rustc_session::HashStableContext for StableHashingContext<'a> {} |
