about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/debuginfo
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-07-12 22:19:25 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-07-06 22:50:55 +0200
commit43bb31b9540a439dcca65f47b8644eafe4a42e2d (patch)
tree8c707ae5bb7b76fd39b0b0b811e50fd336e5cd17 /compiler/rustc_codegen_llvm/src/debuginfo
parent3dcb616888aac50d55160b025266d555dad937d9 (diff)
downloadrust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.tar.gz
rust-43bb31b9540a439dcca65f47b8644eafe4a42e2d.zip
Allow to create definitions inside the query system.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
index 87fbb737ea8..8fc8118849b 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs
@@ -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()
     }