panic

Function panic 

Source
pub fn panic(info: &PanicInfo<'_>) -> !
Expand description

Custom panic handler for the kernel.

§How it works

  • This function is called automatically by Rust when a panic occurs.
  • It logs a generic error message and detailed panic info over the serial port.
  • It then halts the CPU to prevent further execution, as continuing after a panic is unsafe in kernel code.

§Arguments

§Note

The #[panic_handler] attribute tells the Rust compiler to use this function as the panic handler in no_std builds.