美文网首页
Rust 使用#![no_std]提示 found duplic

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

作者: Gascognya | 来源:发表于2020-10-16 23:49 被阅读0次

    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))]即可

    相关文章

      网友评论

          本文标题:Rust 使用#![no_std]提示 found duplic

          本文链接:https://www.haomeiwen.com/subject/prxxmktx.html