diff options
| author | Ralf Jung <post@ralfj.de> | 2024-03-23 09:40:16 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-03-23 09:44:04 +0100 |
| commit | fc257fae3c6d4adc6effb2535fb9130d8c15e3ff (patch) | |
| tree | b732ade18a72213fd5cfbbc6898f5ea168a3a768 /library/core/src/panic | |
| parent | e3df96cfda905301fc8514e000f942222c1ab6ad (diff) | |
add panic location to 'panicked while processing panic'
Diffstat (limited to 'library/core/src/panic')
| -rw-r--r-- | library/core/src/panic/panic_info.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs index c77e9675a6a..40326221258 100644 --- a/library/core/src/panic/panic_info.rs +++ b/library/core/src/panic/panic_info.rs @@ -161,11 +161,12 @@ impl fmt::Display for PanicInfo<'_> { fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { formatter.write_str("panicked at ")?; self.location.fmt(formatter)?; + formatter.write_str(":")?; if let Some(message) = self.message { - formatter.write_str(":\n")?; + formatter.write_str("\n")?; formatter.write_fmt(*message)?; } else if let Some(payload) = self.payload.downcast_ref::<&'static str>() { - formatter.write_str(":\n")?; + formatter.write_str("\n")?; formatter.write_str(payload)?; } // NOTE: we cannot use downcast_ref::<String>() here |
