File tree 3 files changed +10
-1
lines changed
test/run-make-fulldeps/treat-err-as-bug
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -869,7 +869,10 @@ impl HandlerInner {
869
869
}
870
870
871
871
fn delay_span_bug ( & mut self , sp : impl Into < MultiSpan > , msg : & str ) {
872
- if self . treat_err_as_bug ( ) {
872
+ // 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 ) {
873
876
// FIXME: don't abort here if report_delayed_bugs is off
874
877
self . span_bug ( sp, msg) ;
875
878
}
Original file line number Diff line number Diff line change 3
3
all :
4
4
$(RUSTC ) err.rs -Z treat-err-as-bug 2>&1 \
5
5
| $(CGREP ) " panicked at 'aborting due to \` -Z treat-err-as-bug=1\` '"
6
+ $(RUSTC ) delay_span_bug.rs -Z treat-err-as-bug 2>&1 \
7
+ | $(CGREP ) " panicked at 'aborting due to \` -Z treat-err-as-bug=1\` '"
Original file line number Diff line number Diff line change
1
+ #![ feature( rustc_attrs) ]
2
+
3
+ #[ rustc_error( delay_span_bug_from_inside_query) ]
4
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments