This Pre-RFC proposes to add a
[doc-dependencies] property to Cargo.toml.
There are some proc-macro crates dedicated for generating documentation
(not giving examples to avoid distraction on individual cases).
It wastes compile time to compile these crates
(which tend to use
syn, which is an infamous compile time bottleneck)
when they are not useful as transitive dependencies in
cargo build etc.,
but they cannot be made dev-dependencies
because they're still required for transitive dependencies in
[doc-dependencies] are compiled only when documentation needs to be generated.
This includes transitive
cargo doc and direct
the latter because of the generation of doc tests.
Users of doc-dependencies should conditionally compile usages
with gates such as