Rust 使用#![no_std]提示 found duplic

2020-10-16  本文已影响0人  Gascognya

https://users.rust-lang.org/t/resolved-test-with-no-std/8491
直接贴出

RLS还不能很好的适配#![no_std]

#![no_std]

use core::panic::PanicInfo;

fn main() {}

#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop {}
}

定义panic还是会提示已存在,加上#[cfg(not(test))]即可

上一篇下一篇

猜你喜欢

热点阅读