Open glandium opened 6 years ago
I have the same issue even after 2 years (2020)
just hit the same issue today. any follow-up on this?
I have the same issue https://github.com/rust-lang/rust/issues/100766.
It doesn't seem to be well resolved.
However, I found some options in Cargo test :
I noted that I can use the --lib
to special some libraries what I want to link. So I tried to special linking the test
library:
cargo test --lib test
And in lib.rs
:
- #![cfg_attr(not(test), no_std)]
+ // specify no_std does not mean that the std crate cannot be linked.
+ // https://doc.rust-lang.org/reference/names/preludes.html#the-no_std-attribute
+ #![no_std]
It is now ready to run tests for the time being.
That is an error that is expected with
no_std
, but the code is supposed to be essentially empty in thetest
configuration.It works when
crate-type
contains only one value (either one).