Skip to content

Commit 47ce741

Browse files
committed
Do not access the dep_node only for debugging.
1 parent 08168b5 commit 47ce741

File tree

1 file changed

+11
-5
lines changed
  • compiler/rustc_query_system/src/dep_graph

1 file changed

+11
-5
lines changed

compiler/rustc_query_system/src/dep_graph/graph.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ impl<K: DepKind> DepGraph<K> {
472472
parent_dep_node_index: SerializedDepNodeIndex,
473473
dep_node: &DepNode<K>,
474474
) -> Option<()> {
475-
let dep_dep_node = &data.previous.read().index_to_node(parent_dep_node_index);
476475
let dep_dep_node_color = data.previous.read().color_or_edges(parent_dep_node_index);
477476
let prev_deps = match dep_dep_node_color {
478477
Ok(DepNodeColor::Green) => {
@@ -481,7 +480,8 @@ impl<K: DepKind> DepGraph<K> {
481480
// dependencies.
482481
debug!(
483482
"try_mark_parent_green({:?}) --- found dependency {:?} to be immediately green",
484-
dep_node, dep_dep_node,
483+
dep_node,
484+
data.previous.read().index_to_node(parent_dep_node_index)
485485
);
486486
return Some(());
487487
}
@@ -492,7 +492,8 @@ impl<K: DepKind> DepGraph<K> {
492492
// with checking any of the other dependencies.
493493
debug!(
494494
"try_mark_parent_green({:?}) - END - dependency {:?} was immediately red",
495-
dep_node, dep_dep_node,
495+
dep_node,
496+
data.previous.read().index_to_node(parent_dep_node_index)
496497
);
497498
return None;
498499
}
@@ -502,11 +503,16 @@ impl<K: DepKind> DepGraph<K> {
502503
// We don't know the state of this dependency. If it isn't
503504
// an eval_always node, let's try to mark it green recursively.
504505
debug!(
505-
"try_mark_parent_green({:?}) --- state of dependency {:?} ({}) \
506+
"try_mark_parent_green({:?}) --- state of dependency {:?} \
506507
is unknown, trying to mark it green",
507-
dep_node, dep_dep_node, dep_dep_node.hash,
508+
dep_node,
509+
{
510+
let dep_dep_node = data.previous.read().index_to_node(parent_dep_node_index);
511+
(dep_dep_node, dep_dep_node.hash)
512+
}
508513
);
509514

515+
let dep_dep_node = &data.previous.read().index_to_node(parent_dep_node_index);
510516
let node_index =
511517
self.try_mark_previous_green(tcx, data, parent_dep_node_index, prev_deps, dep_dep_node);
512518
if node_index.is_some() {

0 commit comments

Comments
 (0)