Skip to content

Commit 62e4bcb

Browse files
committed
Address comments
1 parent 60ed37c commit 62e4bcb

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ impl<K: DepKind> DepGraph<K> {
250250
/// in the query infrastructure, and is not currently needed by the
251251
/// decoding of any query results. Should the need arise in the future,
252252
/// we should consider extending the query system with this functionality.
253-
pub fn with_query_deserialization<OP, R>(op: OP) -> R
253+
pub fn with_query_deserialization<OP, R>(&self, op: OP) -> R
254254
where
255255
OP: FnOnce() -> R,
256256
{
@@ -881,7 +881,7 @@ impl<K: DepKind> DepGraphData<K> {
881881
);
882882

883883
if !side_effects.is_empty() {
884-
DepGraph::<K>::with_query_deserialization(|| {
884+
qcx.dep_context().dep_graph().with_query_deserialization(|| {
885885
self.emit_side_effects(qcx, dep_node_index, side_effects)
886886
});
887887
}

compiler/rustc_query_system/src/query/plumbing.rs

+12-14
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
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::{
6-
DepContext, DepGraph, DepKind, DepNode, DepNodeIndex, DepNodeParams, TaskDepsRef,
7-
};
5+
use crate::dep_graph::{DepContext, DepKind, DepNode, DepNodeIndex, DepNodeParams};
86
use crate::dep_graph::{DepGraphData, HasDepContext};
97
use crate::ich::StableHashingContext;
108
use crate::query::caches::QueryCache;
@@ -430,13 +428,12 @@ where
430428

431429
// Similarly, fingerprint the result to assert that
432430
// it doesn't have anything not considered hashable.
433-
if cfg!(debug_assertions)
434-
&& let Some(hash_result) = query.hash_result()
435-
{
436-
qcx.dep_context().with_stable_hashing_context(|mut hcx| {
437-
hash_result(&mut hcx, &result);
438-
});
439-
}
431+
if cfg!(debug_assertions) && let Some(hash_result) = query.hash_result()
432+
{
433+
qcx.dep_context().with_stable_hashing_context(|mut hcx| {
434+
hash_result(&mut hcx, &result);
435+
});
436+
}
440437

441438
return (result, dep_node_index);
442439
}
@@ -524,9 +521,10 @@ where
524521
// The call to `with_query_deserialization` enforces that no new `DepNodes`
525522
// are created during deserialization. See the docs of that method for more
526523
// details.
527-
let result = DepGraph::<Qcx::DepKind>::with_query_deserialization(|| {
528-
try_load_from_disk(qcx, prev_dep_node_index)
529-
});
524+
let result = qcx
525+
.dep_context()
526+
.dep_graph()
527+
.with_query_deserialization(|| try_load_from_disk(qcx, prev_dep_node_index));
530528

531529
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
532530

@@ -575,7 +573,7 @@ where
575573
let prof_timer = qcx.dep_context().profiler().query_provider();
576574

577575
// The dep-graph for this computation is already in-place.
578-
let result = Qcx::DepKind::with_deps(TaskDepsRef::Ignore, || query.compute(qcx, *key));
576+
let result = qcx.dep_context().dep_graph().with_ignore(|| query.compute(qcx, *key));
579577

580578
prof_timer.finish_with_query_invocation_id(dep_node_index.into());
581579

0 commit comments

Comments
 (0)