Compilation error with RISC-V assembly?

First try to add RISC-V assembly code to rust.


use core::panic::PanicInfo;

fn panic(_info: &PanicInfo) -> ! {

pub extern "C" fn _start() -> ! {
unsafe {

 loop{ }


rustc --target=riscv32imac-unknown-none-elf -o main.o

error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
39 | asm!("nop");

Can someone tell me what is wrong and how to fix? The code compiles without the assembly code.

Updating the rustc compiler and importing core asm resolved the issue.

use core::arch::asm;

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.