diff --git a/theseus/src/lib.rs b/theseus/src/lib.rs index 359c7a4..56f1c08 100644 --- a/theseus/src/lib.rs +++ b/theseus/src/lib.rs @@ -11,17 +11,16 @@ pub mod uart; extern "C" { // printf.c - fn panic(s: *const u8); + fn panic(s: *const i8); } -/// '!RUST PANIC!\0' -static PANIC_MSG: [u8; 13] = [33, 82, 85, 83, 84, 32, 80, 65, 78, 73, 67, 33, 0]; +static PANIC_MSG: &CStr = c"!RUST PANIC!"; #[panic_handler] #[no_mangle] fn panic_handler(_info: &core::panic::PanicInfo) -> ! { unsafe { - panic(core::ptr::addr_of!(PANIC_MSG[0])); + panic(PANIC_MSG.as_ptr()); } loop {} }