From a57c8e410dddaccd109457baaebd4f9a1f509f42 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:30:53 +0200 Subject: [PATCH] Avoid warnings from rust-analyzer for the panic handler Rust-analyzer runs cargo check --all-targets which also checks the test configuration where previously there would be a bunch of warnings for unused things due to the panic handler being configured out. --- src/panic.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panic.rs b/src/panic.rs index f74e6a6b39..d667b02161 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -25,7 +25,12 @@ use crate::{ /// Required to handle panics #[cfg(not(test))] #[panic_handler] -fn rust_begin_unwind(info: &PanicInfo) -> ! { +fn panic_handler(info: &PanicInfo) -> ! { + panic_handler_inner(info) +} + +#[cfg_attr(test, expect(dead_code))] +fn panic_handler_inner(info: &PanicInfo) -> ! { println!("KERNEL PANIC: {}", info); unsafe {