Skip to content

Commit 49560e9

Browse files
committed
Ban deps only during query loading from disk
1 parent 75181dc commit 49560e9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//! generate the actual methods on tcx which find and execute the provider,
33
//! manage the caches, and so forth.
44
5-
use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams};
5+
use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams, TaskDeps};
66
use crate::query::caches::QueryCache;
77
use crate::query::config::{QueryDescription, QueryVtable};
88
use crate::query::job::{
99
report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryShardJobId,
1010
};
1111
use crate::query::{QueryContext, QueryMap, QuerySideEffects, QueryStackFrame};
12-
12+
use crate::dep_graph::DepKind;
1313
use rustc_data_structures::fingerprint::Fingerprint;
1414
use rustc_data_structures::fx::{FxHashMap, FxHasher};
1515
#[cfg(parallel_compiler)]
@@ -515,7 +515,13 @@ where
515515
// Some things are never cached on disk.
516516
if query.cache_on_disk {
517517
let prof_timer = tcx.dep_context().profiler().incr_cache_loading();
518-
let result = query.try_load_from_disk(tcx, prev_dep_node_index);
518+
519+
let mut deps = TaskDeps::default();
520+
deps.read_allowed = false;
521+
let deps = Lock::new(deps);
522+
let result = CTX::DepKind::with_deps(Some(&deps), || {
523+
query.try_load_from_disk(tcx, prev_dep_node_index)
524+
});
519525
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
520526

521527
if let Some(result) = result {

0 commit comments

Comments
 (0)