Use the right level with -Ztreat-err-as-bug
.
Errors in `DiagCtxtInner::emit_diagnostic` are never set to `Level::Bug`, because the condition never succeeds, because `self.treat_err_as_bug()` is called *before* the error counts are incremented. This commit switches to `self.treat_next_err_as_bug()`, fixing the problem. This changes the error message output to actually say "internal compiler error".
This commit is contained in:
parent
f0a3684c1e
commit
2aac288c18
6 changed files with 6 additions and 6 deletions
|
@ -1256,7 +1256,7 @@ impl DiagCtxtInner {
|
|||
}
|
||||
|
||||
fn emit_diagnostic(&mut self, mut diagnostic: Diagnostic) -> Option<ErrorGuaranteed> {
|
||||
if matches!(diagnostic.level, Error | Fatal) && self.treat_err_as_bug() {
|
||||
if matches!(diagnostic.level, Error | Fatal) && self.treat_next_err_as_bug() {
|
||||
diagnostic.level = Bug;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue