We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 66f7a5d commit 230e406Copy full SHA for 230e406
src/librustc_errors/lib.rs
@@ -869,7 +869,10 @@ impl HandlerInner {
869
}
870
871
fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) {
872
- if self.treat_err_as_bug() {
+ // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before
873
+ // incrementing `err_count` by one, so we need to +1 the comparing.
874
+ // FIXME: Would be nice to increment err_count in a more coherent way.
875
+ if self.flags.treat_err_as_bug.map(|c| self.err_count() + 1 >= c).unwrap_or(false) {
876
// FIXME: don't abort here if report_delayed_bugs is off
877
self.span_bug(sp, msg);
878
0 commit comments