Skip to content

Commit d140381

Browse files
committed
Move to target_arch
1 parent 4d6bee9 commit d140381

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/lib.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@
1212
#![no_main]
1313
#![macro_use]
1414

15-
#[cfg(all(
16-
not(any(feature = "cortex-m", feature = "risc-v")),
17-
all(not(test), feature = "panic-handler")
18-
))]
19-
compile_error!("Enable either the cortex-m or risc-v feature");
20-
2115
#[cfg(all(not(test), feature = "panic-handler"))]
2216
#[panic_handler]
2317
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+
2421
unsafe {
25-
#[cfg(feature = "cortex-m")]
22+
#[cfg(target_arch = "arm")]
2623
core::arch::asm!("udf #0");
27-
#[cfg(feature = "risc-v")]
24+
#[cfg(target_arch = "riscv32")]
2825
core::arch::asm!("UNIMP");
2926
core::hint::unreachable_unchecked();
3027
}

0 commit comments

Comments
 (0)