diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index 210bdd8d5ddca..0ad79eacd2b03 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -648,8 +648,15 @@ impl DepGraph { 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 {