Fix display of panic message in recursive panic.

This commit is contained in:
Mara Bos
2024-05-16 12:59:09 +02:00
parent 877a26f6c9
commit fb0990d1e1
2 changed files with 11 additions and 9 deletions

View File

@@ -157,4 +157,9 @@ pub unsafe trait PanicPayload: crate::fmt::Display {
/// Just borrow the contents.
fn get(&mut self) -> &(dyn Any + Send);
/// Try to borrow the contents as `&str`, if possible without doing any allocations.
fn as_str(&mut self) -> Option<&str> {
None
}
}