Skip to content

Commit cf5cc2e

Browse files
committed
Auto merge of #49088 - michaelwoerister:fix-49070, r=nikomatsakis
incr.comp.: Make sanity check in try_mark_green() aware of error conditions. Before this PR, `DepGraph::try_mark_green()` assumed that forcing a query would always set the color of the corresponding dep-node. However, it did not take into account that queries could also fail (e.g. with a cycle error). This PR makes the method handle that condition gracefully. Fixes #49070. r? @nikomatsakis
2 parents 55c984e + ee4a7eb commit cf5cc2e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/librustc/dep_graph/graph.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,15 @@ impl DepGraph {
648648
return None
649649
}
650650
None => {
651-
bug!("try_mark_green() - Forcing the DepNode \
652-
should have set its color")
651+
if !tcx.sess.has_errors() {
652+
bug!("try_mark_green() - Forcing the DepNode \
653+
should have set its color")
654+
} else {
655+
// If the query we just forced has resulted
656+
// in some kind of compilation error, we
657+
// don't expect that the corresponding
658+
// dep-node color has been updated.
659+
}
653660
}
654661
}
655662
} else {

0 commit comments

Comments
 (0)