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
This commit is contained in:
bors
2018-03-17 00:48:10 +00:00
+9 -2
View File
@@ -648,8 +648,15 @@ pub fn try_mark_green<'tcx>(&self,
return None
}
None => {
bug!("try_mark_green() - Forcing the DepNode \
should have set its color")
if !tcx.sess.has_errors() {
bug!("try_mark_green() - Forcing the DepNode \
should have set its color")
} else {
// If the query we just forced has resulted
// in some kind of compilation error, we
// don't expect that the corresponding
// dep-node color has been updated.
}
}
}
} else {