From 8e0faa91828c0f0a4dd34abe516d06b191c828b4 Mon Sep 17 00:00:00 2001 From: M Farkas-Dyck Date: Sat, 18 Aug 2018 10:22:05 -0800 Subject: [PATCH] these raw instructions are unsafe --- src/asm.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/asm.rs b/src/asm.rs index 48d46be..14ab476 100644 --- a/src/asm.rs +++ b/src/asm.rs @@ -3,12 +3,10 @@ macro_rules! instruction { ($fnname:ident, $asm:expr) => ( #[inline] - pub fn $fnname() { + pub unsafe fn $fnname() { match () { #[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] - () => unsafe { - asm!($asm :::: "volatile"); - }, + () => asm!($asm :::: "volatile"), #[cfg(not(any(target_arch = "riscv32", target_arch = "riscv64")))] () => {} }