Allow to create definitions inside the query system.

This commit is contained in:
Camille GILLOT 2021-07-12 22:19:25 +02:00
parent 3dcb616888
commit 43bb31b954
23 changed files with 260 additions and 150 deletions

View file

@ -93,8 +93,9 @@ impl<'tcx> UniqueTypeId<'tcx> {
/// Right now this takes the form of a hex-encoded opaque hash value.
pub fn generate_unique_id_string(self, tcx: TyCtxt<'tcx>) -> String {
let mut hasher = StableHasher::new();
let mut hcx = tcx.create_stable_hashing_context();
hcx.while_hashing_spans(false, |hcx| self.hash_stable(hcx, &mut hasher));
tcx.with_stable_hashing_context(|mut hcx| {
hcx.while_hashing_spans(false, |hcx| self.hash_stable(hcx, &mut hasher))
});
hasher.finish::<Fingerprint>().to_hex()
}