I am trying to import my own std library, but when I am compiling with crates dependencies I have this issue:
error: duplicate lang item in crate `std`: `f32`.
|
= note: first defined in crate `my_std`.
error: duplicate lang item in crate `std`: `f64`.
|
= note: first defined in crate `my_std`.
error: duplicate lang item in crate `std`: `panic_fmt`.
|
= note: first defined in crate `my_std`.
I tried to overwrite the library by writing extern crate my_std as std
What would be the easy way to fix that - and not modify this for all dependencies?
You can compile your code without the Rust standard library by using #![no_std] attribute in your crate root. Note that there are some caveats to doing this with an executable (as opposed to a library), and you will need to manually include libc for a binary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With