From ee4a7eba451cc631a8fb7ab4562d37074ec7b048 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 16 Mar 2018 16:18:14 +0100 Subject: [PATCH] incr.comp.: Make sanity check in try_mark_green() aware of error conditions. --- src/librustc/dep_graph/graph.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 {