diff --git a/src/lib.rs b/src/lib.rs index 336799e..07be73d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![feature(start)] #![feature(const_fn_floating_point_arithmetic)] -#![feature(panic_info_message)] use alloc::fmt; use alloc::vec::Vec; diff --git a/src/panic.rs b/src/panic.rs index 477b18a..28cc38b 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -31,14 +31,9 @@ fn panic(info: &core::panic::PanicInfo) -> ! { None => ("(unknown file)", 0), }; - if let Some(m) = info.message() { - let _ = write!(ConsoleWriter, "PANIC: {m}\n at {file}:{line}"); - } else if let Some(m) = info.payload().downcast_ref::<&str>() { - let _ = write!(ConsoleWriter, "PANIC: {m}\n at {file}:{line}"); - } else { - let _ = write!(ConsoleWriter, "PANIC: (no message)\n at {file}:{line}"); - } + let message = info.message(); + + let _ = write!(ConsoleWriter, "PANIC: {message}\n at {file}:{line}"); } - loop {} }