about summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-12-14 10:59:29 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-12-23 13:38:53 -0500
commit49560e9c4933cbec077156b4645888211893339f (patch)
tree8b0c43f2ca0033857f5ce2c823ff60a75c0b35d2 /compiler/rustc_query_system
parent75181dc22f6e25760a95fdc4ad92f9a054506486 (diff)
Ban deps only during query loading from disk
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/query/plumbing.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs
index e4a177cbffb..fd22698e419 100644
--- a/compiler/rustc_query_system/src/query/plumbing.rs
+++ b/compiler/rustc_query_system/src/query/plumbing.rs
@@ -2,14 +2,14 @@
 //! generate the actual methods on tcx which find and execute the provider,
 //! manage the caches, and so forth.
 
-use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams};
+use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams, TaskDeps};
 use crate::query::caches::QueryCache;
 use crate::query::config::{QueryDescription, QueryVtable};
 use crate::query::job::{
     report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryShardJobId,
 };
 use crate::query::{QueryContext, QueryMap, QuerySideEffects, QueryStackFrame};
-
+use crate::dep_graph::DepKind;
 use rustc_data_structures::fingerprint::Fingerprint;
 use rustc_data_structures::fx::{FxHashMap, FxHasher};
 #[cfg(parallel_compiler)]
@@ -515,7 +515,13 @@ where
     // Some things are never cached on disk.
     if query.cache_on_disk {
         let prof_timer = tcx.dep_context().profiler().incr_cache_loading();
-        let result = query.try_load_from_disk(tcx, prev_dep_node_index);
+
+        let mut deps = TaskDeps::default();
+        deps.read_allowed = false;
+        let deps = Lock::new(deps);
+        let result = CTX::DepKind::with_deps(Some(&deps), || {
+            query.try_load_from_disk(tcx, prev_dep_node_index)
+        });
         prof_timer.finish_with_query_invocation_id(dep_node_index.into());
 
         if let Some(result) = result {