Skip to content

Make panic! error message GCC compatible #25152

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/libstd/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ pub fn on_panic(obj: &(Any+Send), file: &'static str, line: u32) {
Some(mut stderr) => {
// FIXME: what to do when the thread printing panics?
let _ = writeln!(stderr,
"thread '{}' panicked at '{}', {}:{}\n",
name, msg, file, line);
"{}:{}: thread '{}' panicked at '{}'",
file, line, name, msg);
if backtrace::log_enabled() {
let _ = backtrace::write(&mut *stderr);
}
Expand All @@ -52,8 +52,8 @@ pub fn on_panic(obj: &(Any+Send), file: &'static str, line: u32) {
});
}
None => {
let _ = writeln!(&mut err, "thread '{}' panicked at '{}', {}:{}",
name, msg, file, line);
let _ = writeln!(&mut err, "{}:{}: thread '{}' panicked at '{}'",
file, line, name, msg);
if backtrace::log_enabled() {
let _ = backtrace::write(&mut err);
}
Expand Down