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.
This commit is contained in:
bjorn3
2025-10-19 14:30:53 +02:00
parent 021cdf47f4
commit a57c8e410d
+6 -1
View File
@@ -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 {