First try to add RISC-V assembly code to rust.
#![no_std]
#![no_main]
#![allow(dead_code)]
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop{}
}
#[no_mangle]
pub extern "C" fn _start() -> ! {
unsafe {
asm!("nop");
}
loop{ }
}
rustc --target=riscv32imac-unknown-none-elf -o main.o main.rs
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
--> main.rs:39:5
|
39 | asm!("nop");
Can someone tell me what is wrong and how to fix? The code compiles without the assembly code.