From b91fa54ea3045f30ac2f045a07426a756a8897d8 Mon Sep 17 00:00:00 2001 From: Xuejie Xiao Date: Mon, 1 Jan 2024 08:20:09 +0000 Subject: [PATCH] fix: Only alter panic handler in riscv64 target Previously the panic handler is inserted in all targets. This would make clippy complain about the following error: ``` error[E0152]: found duplicate lang item `panic_impl` ``` By only altering panic handler in riscv64 target, the error would now go away --- src/entry.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/entry.rs b/src/entry.rs index e7e837b..7ebcc97 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -50,6 +50,7 @@ macro_rules! entry { "ecall", ); + #[cfg(target_arch = "riscv64")] #[panic_handler] fn panic_handler(panic_info: &core::panic::PanicInfo) -> ! { $crate::debug!("{}", panic_info);