|
2 | 2 | //! generate the actual methods on tcx which find and execute the provider, |
3 | 3 | //! manage the caches, and so forth. |
4 | 4 |
|
5 | | -use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams}; |
| 5 | +use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams, TaskDeps}; |
6 | 6 | use crate::query::caches::QueryCache; |
7 | 7 | use crate::query::config::{QueryDescription, QueryVtable}; |
8 | 8 | use crate::query::job::{ |
9 | 9 | report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryShardJobId, |
10 | 10 | }; |
11 | 11 | use crate::query::{QueryContext, QueryMap, QuerySideEffects, QueryStackFrame}; |
12 | | - |
| 12 | +use crate::dep_graph::DepKind; |
13 | 13 | use rustc_data_structures::fingerprint::Fingerprint; |
14 | 14 | use rustc_data_structures::fx::{FxHashMap, FxHasher}; |
15 | 15 | #[cfg(parallel_compiler)] |
@@ -515,7 +515,13 @@ where |
515 | 515 | // Some things are never cached on disk. |
516 | 516 | if query.cache_on_disk { |
517 | 517 | 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 | + }); |
519 | 525 | prof_timer.finish_with_query_invocation_id(dep_node_index.into()); |
520 | 526 |
|
521 | 527 | if let Some(result) = result { |
|
0 commit comments