cargo rustdoc
should build docs for dependencies
#2594
Labels
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-rustdoc
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
The
rustdoc
subcommand currently only builds documentation for the specified crate, and none of its dependencies. This is different from the behavior ofcargo rustc
which builds all dependencies (though that is by necessity) andcargo doc
which includes all dependencies.When building for custom targets, it is necessary to use
cargo rustdoc
to pass-Lpath
to allow it to find the system libraries such as libcore. This only documents one crate, however, so getting the same behavior ascargo doc
requires multiple invocations ofcargo rustdoc
with some glue logic to find dependencies.Alternate approach that would also fix my issue: accept a
RUSTDOCFLAGS
environment variable similar to howRUSTFLAGS
is currently handled. This is a feasible solution if the current limited behavior ofcargo rustdoc
is desired.The text was updated successfully, but these errors were encountered: