Tweak ICE message

Modify main message to be more conversational and emit one fewer note.
This commit is contained in:
Esteban Küber 2023-02-07 19:17:24 +00:00
parent e4dd9edb76
commit a7597a1526
9 changed files with 9 additions and 16 deletions

View File

@ -1200,11 +1200,9 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
if !info.payload().is::<rustc_errors::ExplicitBug>()
&& !info.payload().is::<rustc_errors::DelayedBugPanic>()
{
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
handler.emit_diagnostic(&mut d);
handler.emit_err(session_diagnostics::Ice);
}
handler.emit_note(session_diagnostics::Ice);
handler.emit_note(session_diagnostics::IceBugReport { bug_report_url });
handler.emit_note(session_diagnostics::IceVersion {
version: util::version_str!().unwrap_or("unknown_version"),

View File

@ -1,8 +1,7 @@
// compile-flags: -Ztreat-err-as-bug=1
// failure-status: 101
// rustc-env:RUST_BACKTRACE=1
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "\nerror: .*unexpectedly panicked.*\n\n" -> ""
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""

View File

@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
--> $DIR/const-eval-query-stack.rs:17:16
--> $DIR/const-eval-query-stack.rs:16:16
|
LL | const X: i32 = 1 / 0;
| ^^^^^ attempt to divide `1_i32` by zero

View File

@ -3,7 +3,7 @@
// known-bug: #106191
// unset-rustc-env:RUST_BACKTRACE
// had to be reverted
// error-pattern:internal compiler error
// error-pattern:unexpectedly panicked
// failure-status:101
// dont-check-compiler-stderr

View File

@ -9,9 +9,7 @@ LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResu
stack backtrace:
error: internal compiler error: unexpected panic
error: the compiler unexpectedly panicked. this is a bug.

View File

@ -1,4 +1,4 @@
error: internal compiler error: unexpected panic
error: the compiler unexpectedly panicked. this is a bug.
query stack during panic:
#0 [layout_of] computing layout of `Foo`

View File

@ -4,9 +4,7 @@ LL | fn main() { missing_ident; }
stack backtrace:
error: internal compiler error: unexpected panic
error: the compiler unexpectedly panicked. this is a bug.

View File

@ -4,7 +4,7 @@ error: internal compiler error: delayed span bug triggered by #[rustc_error(dela
LL | fn main() {}
| ^^^^^^^^^
error: internal compiler error: unexpected panic
error: the compiler unexpectedly panicked. this is a bug.
query stack during panic:
#0 [trigger_delay_span_bug] triggering a delay span bug

View File

@ -4,7 +4,7 @@ error[E0080]: could not evaluate static initializer
LL | pub static C: u32 = 0 - 1;
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
error: internal compiler error: unexpected panic
error: the compiler unexpectedly panicked. this is a bug.
query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `C`