rust在禁用标准库后,编译器又去检查std,出现重复定义报错
#![no_std]
fn main() {}
use core::panic::PanicInfo;
/// 这个函数将在 panic 时被调用
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
//此时出现检查报错
//found duplicate lang item `panic_impl`
the lang item is first defined in crate `std` (which `test` depends on)
first definition in `std` loaded from \\?\C:\Users\zheng'du'niao\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-9505d954cc550ca4.rlib
second definition in the local crate (`genius`)rustcE0152
说明还是去查了std库,而我在前面已经禁用std了,print!宏也失效了,代表确实没有引std,但这里却出现了矛盾