Skip to content

Commit 1313678

Browse files
committed
Address comments
1 parent 8ef7413 commit 1313678

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/librustc/dep_graph/graph.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ impl DepGraph {
545545
Some(DepNodeColor::Green(dep_node_index)) => Some((prev_index, dep_node_index)),
546546
Some(DepNodeColor::Red) => None,
547547
None => {
548+
// This DepNode and the corresponding query invocation existed
549+
// in the previous compilation session too, so we can try to
550+
// mark it as green by recursively marking all of its
551+
// dependencies green.
548552
self.try_mark_previous_green(
549553
tcx.global_tcx(),
550554
data,
@@ -557,6 +561,7 @@ impl DepGraph {
557561
}
558562
}
559563

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

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

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

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

0 commit comments

Comments
 (0)