Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no_std is broken #138

Closed
MarkSwanson opened this issue Oct 27, 2019 · 3 comments
Closed

no_std is broken #138

MarkSwanson opened this issue Oct 27, 2019 · 3 comments

Comments

@MarkSwanson
Copy link

My Cargo.toml has:
num-traits = { version = ">=0.2.0", default-features = false }

My crate fails to compile when I build it like this:
cargo --verbose build --target thumbv7m-none-eabi

(What confuses me in the output is this --> --cfg 'feature="default"' --cfg 'feature="std"')
(Why is Cargo ignoring: default-features = false ?)

Compiling num-traits v0.2.8
Running rustc --crate-name num_traits /home/mswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.8/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=616873d37e025f24 -C extra-filename=-616873d37e025f24 --out-dir '/mnt/sdb2/@home/mswanson/src/stm32/rust-compression/target/thumbv7m-none-eabi/debug/deps' --target thumbv7m-none-eabi -L 'dependency=/mnt/sdb2/@home/mswanson/src/stm32/rust-compression/target/thumbv7m-none-eabi/debug/deps' -L 'dependency=/mnt/sdb2/@home/mswanson/src/stm32/rust-compression/target/debug/deps' --cap-lints allow --cfg has_i128
error[E0463]: can't find crate for std
--> /home/mswanson/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.8/src/lib.rs:21:1

@CryZe
Copy link
Contributor

CryZe commented Oct 28, 2019

It's probably a dev dependency that is using num-traits as well.

@cuviper
Copy link
Member

cuviper commented Oct 28, 2019

Yes, I think it's an instance of rust-lang/cargo#2589. You could use cargo tree to see where crates are used in your dependency tree, especially inverted like cargo tree -i -p num-traits.

@Sympatron
Copy link

This is probably fixed by now. The new resolver should do a better job of resolving things like that and it hasn't come up again for 4 years.

@cuviper cuviper closed this as completed Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants