mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 03:03:21 +00:00
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
@ -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;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: expected one of `->`, `where`, or `{`, found `<eof>`
|
||||
error: internal compiler error: expected one of `->`, `where`, or `{`, found `<eof>`
|
||||
--> $DIR/ice-bug-report-url.rs:14:10
|
||||
|
|
||||
LL | fn wrong()
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0080]: evaluation of constant value failed
|
||||
error: internal compiler error[E0080]: evaluation of constant value failed
|
||||
--> $DIR/const-eval-query-stack.rs:16:16
|
||||
|
|
||||
LL | const X: i32 = 1 / 0;
|
||||
|
@ -4,7 +4,7 @@ error: unconstrained opaque type
|
||||
LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
error[E0792]: expected generic lifetime parameter, found `'_`
|
||||
error: internal compiler error[E0792]: expected generic lifetime parameter, found `'_`
|
||||
--> $DIR/issue-86800.rs:39:5
|
||||
|
|
||||
LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0425]: cannot find value `missing_ident` in this scope
|
||||
error: internal compiler error[E0425]: cannot find value `missing_ident` in this scope
|
||||
--> $DIR/default-backtrace-ice.rs:21:13
|
||||
|
|
||||
LL | fn main() { missing_ident; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
error[E0080]: could not evaluate static initializer
|
||||
error: internal compiler error[E0080]: could not evaluate static initializer
|
||||
--> $DIR/err.rs:11:21
|
||||
|
|
||||
LL | pub static C: u32 = 0 - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user