Use the Display impl of PanicInfo

This commit is contained in:
bjorn3
2024-03-10 13:41:53 +01:00
parent 89e0a71d10
commit c15c6e1dd2
+1 -7
View File
@@ -3,7 +3,6 @@
asm_const,
alloc_error_handler,
core_intrinsics,
panic_info_message
)]
#[cfg(target_arch = "aarch64")]
@@ -39,12 +38,7 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
}
}
let _ = syscall::write(1, b"panic: ");
if let Some(message) = info.message() {
writeln!(&mut Writer, "{}", message).unwrap();
} else {
let _ = syscall::write(1, b"(explicit panic)\n");
}
let _ = writeln!(&mut Writer, "{}", info);
core::intrinsics::abort();
}