1
Fork 0

Address review comments

This commit is contained in:
Aaron Hill 2021-12-20 21:46:55 -05:00
parent ab168e69ac
commit 28f19f62c7
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 64 additions and 9 deletions

View file

@ -2,8 +2,7 @@
//! generate the actual methods on tcx which find and execute the provider,
//! manage the caches, and so forth.
use crate::dep_graph::DepKind;
use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams, TaskDeps};
use crate::dep_graph::{DepContext, DepNode, DepNodeIndex, DepNodeParams};
use crate::query::caches::QueryCache;
use crate::query::config::{QueryDescription, QueryVtable};
use crate::query::job::{
@ -516,12 +515,12 @@ where
if query.cache_on_disk {
let prof_timer = tcx.dep_context().profiler().incr_cache_loading();
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)
});
// The call to `with_query_deserialization` enforces that no new `DepNodes`
// are created during deserialization. See the docs of that method for more
// details.
let result = dep_graph
.with_query_deserialization(|| 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 {