You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When cargo doc is run on a no_std crate, where a dev-dependency uses std, cargo-doc will fail the build.
Since dev-dependencies are not required for the actual build, this is actually acceptable for cargo build. I would expect cargo doc to not fail the compilation if cargo build is successful.
Steps
Create a crate that is no_std
Utilize a dev-dependency that uses std
Run cargo build, note that build succeeds
Run cargo doc, note that cargo doc fails and indicates no crate found: std
nd-array uses std in this build. If the nd-array dev-depency is updated to use default-features = false, cargo-doc works just fine.
Possible Solution(s)
It's possible that cargo-doc shouldn't be building documentation for dev-dependencies unless explicitly asked, or it should build the dev-dependencies identically to how cargo-build does it.
Notes
$ cargo version
cargo 1.52.0 (69767412a 2021-04-21)
The text was updated successfully, but these errors were encountered:
Closing. This was actually unintended feature unification between dependencies and dev-dependencies that only came up when running cargo doc. Updating the cargo resolver to version 2 resolved this issue.
Problem
When
cargo doc
is run on ano_std
crate, where adev-dependency
usesstd
, cargo-doc will fail the build.Since
dev-dependencies
are not required for the actual build, this is actually acceptable forcargo build
. I would expectcargo doc
to not fail the compilation ifcargo build
is successful.Steps
no_std
dev-dependency
that usesstd
cargo build
, note that build succeedscargo doc
, note that cargo doc fails and indicatesno crate found: std
Note: A sample of this issue can be found in the crate here: https://github.com/quartiq/stabilizer/tree/3a3cbce005a41e53ac8fac1dc68d107502b19511/dsp
nd-array
usesstd
in this build. If thend-array
dev-depency is updated to usedefault-features = false
, cargo-doc works just fine.Possible Solution(s)
It's possible that cargo-doc shouldn't be building documentation for
dev-dependencies
unless explicitly asked, or it should build thedev-dependencies
identically to howcargo-build
does it.Notes
The text was updated successfully, but these errors were encountered: