Is it possible to get cargo doc to also create the documentation for build & dev dependencies? This would be really useful to have locally.
I couldn't find anything in --help, the cargo book or github issues related to this. Can I really be the first person to want it?
jofas
August 27, 2026, 6:49pm
2
This is not yet implemented. The relating issue:
opened 03:16PM - 30 Dec 16 UTC
Command-doc
C-feature-request
S-needs-design
Currently `cargo doc` will build documentation for the crate and its dependencie… s, which is useful as (outside of the core Rust distribution) you get a one stop shop of documentation while working on a crate, however as far as I could see "dev-dependencies" can't be included in that.
This is inconvenient for test-support libraries and for complex "examples" e.g. in a library crate you want a binary which depends on docopt/clap or ncurses or winapi or the Ruby C API or some other large dependency which is completely unnecessary for the core library, but you don't want to fork it to a separate crate, so you make it an example and use dev dependencies, however you've now lost offline access to the "large dependency"'s documentation.
Thanks jofas.
Hmm ... I've just taken on the ownership of a project goal, so I'll see how I get on with that and leave this for now unless it becomes more important to me.
I've added a comment on the github issue that build-dependencies would be nice too.