-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
The rustdoc subcommand currently only builds documentation for the specified crate, and none of its dependencies. This is different from the behavior of cargo rustc which builds all dependencies (though that is by necessity) and cargo 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 as cargo doc requires multiple invocations of cargo rustdoc with some glue logic to find dependencies.
Alternate approach that would also fix my issue: accept a RUSTDOCFLAGS environment variable similar to how RUSTFLAGS is currently handled. This is a feasible solution if the current limited behavior of cargo rustdoc is desired.