Skip to content

Commit 31345cd

Browse files
authored
Rollup merge of #107771 - estebank:ice-msg, r=compiler-errors
Tweak ICE message Modify main message to be more conversational and emit one fewer note.
2 parents 86cc414 + a7597a1 commit 31345cd

File tree

9 files changed

+9
-16
lines changed

9 files changed

+9
-16
lines changed

compiler/rustc_driver_impl/src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,9 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
12001200
if !info.payload().is::<rustc_errors::ExplicitBug>()
12011201
&& !info.payload().is::<rustc_errors::DelayedBugPanic>()
12021202
{
1203-
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
1204-
handler.emit_diagnostic(&mut d);
1203+
handler.emit_err(session_diagnostics::Ice);
12051204
}
12061205

1207-
handler.emit_note(session_diagnostics::Ice);
12081206
handler.emit_note(session_diagnostics::IceBugReport { bug_report_url });
12091207
handler.emit_note(session_diagnostics::IceVersion {
12101208
version: util::version_str!().unwrap_or("unknown_version"),

tests/ui/consts/const-eval/const-eval-query-stack.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// compile-flags: -Ztreat-err-as-bug=1
22
// failure-status: 101
33
// rustc-env:RUST_BACKTRACE=1
4-
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
5-
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
4+
// normalize-stderr-test "\nerror: .*unexpectedly panicked.*\n\n" -> ""
65
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
76
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
87
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""

tests/ui/consts/const-eval/const-eval-query-stack.stderr

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

tests/ui/fmt/respanned-literal-issue-106191.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// known-bug: #106191
44
// unset-rustc-env:RUST_BACKTRACE
55
// had to be reverted
6-
// error-pattern:internal compiler error
6+
// error-pattern:unexpectedly panicked
77
// failure-status:101
88
// dont-check-compiler-stderr
99

tests/ui/impl-trait/issues/issue-86800.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResu
99

1010
stack backtrace:
1111

12-
error: internal compiler error: unexpected panic
13-
14-
12+
error: the compiler unexpectedly panicked. this is a bug.
1513

1614

1715

tests/ui/layout/valid_range_oob.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: internal compiler error: unexpected panic
1+
error: the compiler unexpectedly panicked. this is a bug.
22

33
query stack during panic:
44
#0 [layout_of] computing layout of `Foo`

tests/ui/panics/default-backtrace-ice.stderr

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ LL | fn main() { missing_ident; }
44

55
stack backtrace:
66

7-
error: internal compiler error: unexpected panic
8-
9-
7+
error: the compiler unexpectedly panicked. this is a bug.
108

119

1210

tests/ui/treat-err-as-bug/delay_span_bug.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: internal compiler error: delayed span bug triggered by #[rustc_error(dela
44
LL | fn main() {}
55
| ^^^^^^^^^
66

7-
error: internal compiler error: unexpected panic
7+
error: the compiler unexpectedly panicked. this is a bug.
88

99
query stack during panic:
1010
#0 [trigger_delay_span_bug] triggering a delay span bug

tests/ui/treat-err-as-bug/err.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0080]: could not evaluate static initializer
44
LL | pub static C: u32 = 0 - 1;
55
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
66

7-
error: internal compiler error: unexpected panic
7+
error: the compiler unexpectedly panicked. this is a bug.
88

99
query stack during panic:
1010
#0 [eval_to_allocation_raw] const-evaluating + checking `C`

0 commit comments

Comments
 (0)