Skip to content

Commit

Permalink
Rollup merge of #107771 - estebank:ice-msg, r=compiler-errors
Browse files Browse the repository at this point in the history
Tweak ICE message

Modify main message to be more conversational and emit one fewer note.
  • Loading branch information
matthiaskrgr authored Feb 8, 2023
2 parents 86cc414 + a7597a1 commit 31345cd
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 16 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/const-eval/const-eval-query-stack.rs
Original file line number Diff line number Diff line change
@@ -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" -> ""
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const-eval/const-eval-query-stack.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/fmt/respanned-literal-issue-106191.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions tests/ui/impl-trait/issues/issue-86800.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down
2 changes: 1 addition & 1 deletion tests/ui/layout/valid_range_oob.stderr
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
4 changes: 1 addition & 3 deletions tests/ui/panics/default-backtrace-ice.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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.



Expand Down
2 changes: 1 addition & 1 deletion tests/ui/treat-err-as-bug/delay_span_bug.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/treat-err-as-bug/err.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 31345cd

Please sign in to comment.