Skip to content

Commit a174951

Browse files
incr.comp.: Make assertion in try_mark_green() more targeted.
1 parent 6674773 commit a174951

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/librustc/dep_graph/graph.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,20 @@ impl DepGraph {
519519
current_deps.push(node_index);
520520
continue;
521521
}
522+
} else if cfg!(debug_assertions) {
523+
match dep_dep_node.kind {
524+
DepKind::Hir |
525+
DepKind::HirBody |
526+
DepKind::CrateMetadata => {
527+
assert!(dep_dep_node.extract_def_id(tcx).is_none(),
528+
"Input {:?} should have been pre-allocated but wasn't.",
529+
dep_dep_node);
530+
}
531+
_ => {
532+
// For other kinds of inputs it's OK to be
533+
// forced.
534+
}
535+
}
522536
}
523537

524538
// We failed to mark it green, so we try to force the query.
@@ -549,10 +563,6 @@ impl DepGraph {
549563
}
550564
}
551565
} else {
552-
debug_assert!(!dep_dep_node.kind.is_input() ||
553-
dep_dep_node.extract_def_id(tcx).is_none(),
554-
"Could not force input that should still exist.");
555-
556566
// The DepNode could not be forced.
557567
debug!("try_mark_green({:?}) - END - dependency {:?} \
558568
could not be forced", dep_node, dep_dep_node);

0 commit comments

Comments
 (0)