diff --git a/src/core/debug.rs b/src/core/debug.rs index 14d0be87..5e52f399 100644 --- a/src/core/debug.rs +++ b/src/core/debug.rs @@ -80,3 +80,8 @@ pub fn trap() { #[must_use] pub fn panic_str(p: &Box) -> &'static str { p.downcast_ref::<&str>().copied().unwrap_or_default() } + +#[cfg(debug_assertions)] +#[inline(always)] +#[must_use] +pub fn type_name(_: &T) -> &'static str { std::any::type_name::() }