We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8af3d68 + c8e3fd4 commit 007e610Copy full SHA for 007e610
src/lib.rs
@@ -15,8 +15,14 @@
15
#[cfg(all(not(test), feature = "panic-handler"))]
16
#[panic_handler]
17
fn panic(_info: &core::panic::PanicInfo) -> ! {
18
+ #[cfg(not(any(target_arch = "arm", target_arch = "riscv32")))]
19
+ compile_error!("Panic handler can only be compiled for arm and riscv32");
20
+
21
unsafe {
22
+ #[cfg(target_arch = "arm")]
23
core::arch::asm!("udf #0");
24
+ #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
25
+ core::arch::asm!("UNIMP");
26
core::hint::unreachable_unchecked();
27
}
28
0 commit comments