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))]
即可
网友评论