panic handler
The function a no_std Rust program must provide to decide what happens when it panics.
A #[panic_handler] function receives the PanicInfo and never returns; in firmware it typically logs a message and backtrace and resets or halts the chip.
Examples
An
unwrap()onNonein ESP32-C6 firmware panics; with esp-backtrace linked in, its handler prints a backtrace and halts.Without std there's no default panic handler, so a no_std program that doesn't supply one won't link.
See also