about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2023-06-20 19:16:18 +0200
committerMara Bos <m-ou.se@m-ou.se>2023-07-29 11:42:50 +0200
commit0e729404da1e741e26a398192fcd1614514117cf (patch)
tree5a67cfd4d6629dbfc922321328f6d2f1a8ed8f1f /library/std/src
parent04411507bef1d2db441acdc1d89268f0cbaaccbc (diff)
Change default panic handler message format.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/error.rs3
-rw-r--r--library/std/src/panicking.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/error.rs b/library/std/src/error.rs
index 05f8fd8de32..ee5eddebfaf 100644
--- a/library/std/src/error.rs
+++ b/library/std/src/error.rs
@@ -121,7 +121,8 @@ mod private {
 /// This example produces the following output:
 ///
 /// ```console
-/// thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SuperError is here!: SuperErrorSideKick is here!', src/error.rs:34:40
+/// thread 'main' panicked at src/error.rs:34:40:
+/// called `Result::unwrap()` on an `Err` value: SuperError is here!: SuperErrorSideKick is here!
 /// note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 /// ```
 ///
diff --git a/library/std/src/panicking.rs b/library/std/src/panicking.rs
index 15285465c71..6ff7b19f293 100644
--- a/library/std/src/panicking.rs
+++ b/library/std/src/panicking.rs
@@ -266,7 +266,7 @@ pub fn panic_hook_with_disk_dump(info: &PanicInfo<'_>, path: Option<&crate::path
     let name = thread.as_ref().and_then(|t| t.name()).unwrap_or("<unnamed>");
 
     let write = |err: &mut dyn crate::io::Write, backtrace: Option<BacktraceStyle>| {
-        let _ = writeln!(err, "thread '{name}' panicked at '{msg}', {location}");
+        let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}");
 
         static FIRST_PANIC: AtomicBool = AtomicBool::new(true);