-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak ICE message #107771
Tweak ICE message #107771
Conversation
Modify main message to be more conversational and emit one fewer note.
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Thanks. This is clearer. r? @compiler-errors @bors r+ rollup |
imo "internal compiler error" and "unexpected panic" are very greppable lines where you can almost be 100% sure if you find this in rustcs output, you found a bug in rustc (and not some proc macro or build.rs script..) Does this change anything about the output of delay_span_bugs or is this only for the error after the stacktrace? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point @matthiaskrgr, maybe we should emit the same message as a note on the delayed/non-delayed bug cases like:
@@ -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); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} else { | |
handler.emit_note(session_diagnostics::Ice); | |
} |
edit: I'm dumb, yes we do. |
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, now that I think of it, @matthiaskrgr it should be equally valid to grep for something like "this is a bug" for delayed bug cases like this, rather than "unexpected panic". Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rg
'ed in my local cargo cache
(3K crates, 81 git checkouts)
internal compiler error:
0unexpected panic
14this is a bug
109the compiler unexpectedly panicked
: 0
so "internal compiler error" and "the compiler unexpectedly panicked" gives us the most information because we can almost always be sure, that this is NOT a false positive from for example a format!("internal compiler error")
that needed an extra &
and sneaked into a diagnostic that way...
"this is a bug" however gives us the least amount of information because a bunch of other crates actually use this in their code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well "unexpectedly panicked" should also work as a good grep string then?
|
Tweak ICE message Modify main message to be more conversational and emit one fewer note.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#107656 (Bump rust-installer) - rust-lang#107757 (Allow automatically creating vscode `settings.json` with `x setup`) - rust-lang#107769 (Rename `PointerSized` to `PointerLike`) - rust-lang#107770 (rustdoc: use a newline instead of `<br>` to format code headers) - rust-lang#107771 (Tweak ICE message) - rust-lang#107773 (Clearly signal purpose of the yaml template) - rust-lang#107776 (Docs: Fix format of headings in String::reserve) - rust-lang#107779 (Remove astconv usage in diagnostic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Modify main message to be more conversational and emit one fewer note.