I'm making a toy OS with rust and in order to compile i need to put this functions in my lib.rs
#![feature(lang_items)] #![no_std] ...
#[allow(non_snake_case)] #[no_mangle] pub extern "C" fn _Unwind_Resume() -> ! { loop {} }
#[lang = "eh_personality"] extern "C" fn eh_personality() {}
#[lang = "panic_fmt"] #[no_mangle] pub extern "C" fn panic_fmt() -> ! { loop {} }
and every thing is working but now i want to write some cargo tests so as a start i created this function
#[test] fn it_works() { const i: u8 = 99; assert_eq!(88, i); }
now when i run cargo test i get error [E0152] because of the functions i put earlier
duplicate lang item found: eh_personality first defined in crate panic_unwind
duplicate lang item found: panic_fmt first defined in crate std
as you can see panic_fmt is defined in crate std but i don't use std, if i remove the functions from the lib.rs i can run testes but i'm no longer able to compile and vise versa.
so how can i fix this ?