add panic suite to Error

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk committed 2024-07-13 21:20:05 +00:00
1 parent f10f5319db
commit 0627b46f40
3 files changed
+60 -20

No files matched your search

+4 -3
View File
@@ -1,6 +1,4 @@
#![allow(dead_code)] // this is a developer's toolbox
use std::panic;
use std::{any::Any, panic};
/// Export all of the ancillary tools from here as well.
pub use crate::utils::debug::*;
@@ -79,3 +77,6 @@ pub fn trap() {
std::arch::asm!("int3");
}
}
#[must_use]
pub fn panic_str(p: &Box<dyn Any + Send>) -> &'static str { p.downcast_ref::<&str>().copied().unwrap_or_default() }