Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Jan 15, 2019
1 parent 8ef7413 commit 1313678
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/librustc/dep_graph/graph.rs
Expand Up @@ -545,6 +545,10 @@ impl DepGraph {
Some(DepNodeColor::Green(dep_node_index)) => Some((prev_index, dep_node_index)),
Some(DepNodeColor::Red) => None,
None => {
// This DepNode and the corresponding query invocation existed
// in the previous compilation session too, so we can try to
// mark it as green by recursively marking all of its
// dependencies green.
self.try_mark_previous_green(
tcx.global_tcx(),
data,
Expand All @@ -557,6 +561,7 @@ impl DepGraph {
}
}

/// Try to mark a dep-node which existed in the previous compilation session as green
fn try_mark_previous_green<'tcx>(
&self,
tcx: TyCtxt<'_, 'tcx, 'tcx>,
Expand All @@ -572,12 +577,10 @@ impl DepGraph {
debug_assert!(data.colors.get(prev_dep_node_index).is_none());
}

// We never try to mark inputs as green
debug_assert!(!dep_node.kind.is_input());
debug_assert_eq!(data.previous.index_to_node(prev_dep_node_index), *dep_node);

// We never try to mark inputs as green
// FIXME: Make an debug_assert!
assert!(!dep_node.kind.is_input());
debug_assert_eq!(data.previous.index_to_node(prev_dep_node_index), *dep_node);

let prev_deps = data.previous.edge_targets_from(prev_dep_node_index);

Expand Down

0 comments on commit 1313678

Please sign in to comment.