diff --git a/build b/build index 9766b105..110a5369 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 9766b105dbd7a5b692b401daf8f015f88cda1e04 +Subproject commit 110a5369548036d4073ce98fa78e89d949c0034f diff --git a/src/kmain.rs b/src/kmain.rs index 27fb3573..9f70b4a3 100644 --- a/src/kmain.rs +++ b/src/kmain.rs @@ -9,9 +9,8 @@ #![forbid(clippy::large_stack_frames)] #![forbid(clippy::large_stack_arrays)] #![feature(allocator_api)] // kheap uses this. -#![feature(panic_info_message)] // kpanic uses this. #![feature(ptr_sub_ptr)] // slab uses this. -#![feature(pointer_is_aligned)] // mboot uses this. +#![feature(pointer_is_aligned_to)] // mboot uses this. #![feature(asm_const)] // gdt uses this. #![feature(const_mut_refs)] // tss uses this. #![feature(linked_list_remove)] // vmem uses this. diff --git a/src/kpanic.rs b/src/kpanic.rs index 4fd2fc4c..c98ab928 100644 --- a/src/kpanic.rs +++ b/src/kpanic.rs @@ -12,7 +12,10 @@ use crate::klog::{ use ::core::{ fmt::Write, hint, - panic::PanicInfo, + panic::{ + PanicInfo, + PanicMessage, + }, }; //================================================================================================== @@ -40,13 +43,8 @@ pub fn kpanic(info: &PanicInfo) -> ! { }; // Print panic information. - if let Some(m) = info.message() { - let _ = write!(klog, "file='{}', line={} :: {}", file, line, m); - } else if let Some(m) = info.payload().downcast_ref::<&str>() { - let _ = write!(klog, "file='{}', line={} :: {}", file, line, m); - } else { - let _ = write!(klog, "file='{}', line={} :: ?", file, line); - } + let m: PanicMessage = info.message(); + let _ = write!(klog, "file='{}', line={} :: {}", file, line, m); } loop {