1
Fork 0

Move stable hash from TyS into a datastructure that can be shared with other interned types.

This commit is contained in:
Oli Scherer 2022-03-01 14:51:08 +00:00
parent df20355fa9
commit 00c24dd8ce
8 changed files with 140 additions and 64 deletions

View file

@ -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> {}