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 {