]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/interpret/validity.rs
Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJung
[rust.git] / src / librustc_mir / interpret / validity.rs
index e563cf78f8adcd022b99e4050b0c99250fcecc20..4f90f83b735d1e8c50adf02415ed26c17ecf6b0e 100644 (file)
@@ -416,7 +416,7 @@ fn check_safe_pointer(
             if let Some(ptr) = ptr {
                 // not a ZST
                 // Skip validation entirely for some external statics
-                let alloc_kind = self.ecx.tcx.alloc_map.lock().get(ptr.alloc_id);
+                let alloc_kind = self.ecx.tcx.get_global_alloc(ptr.alloc_id);
                 if let Some(GlobalAlloc::Static(did)) = alloc_kind {
                     // See const_eval::machine::MemoryExtra::can_access_statics for why
                     // this check is so important.