Passing '--all-features' flag to 'cargo doc' does not trigger rebuild #7370
Closed
Description
Problem
When running cargo doc
, adding or removing the --all-features
flag does not cause docs to rebuilt. However, enabling or disabling features can affect the generated documentation if exported types/methods are behind a #[cfg(feature)]
.
Steps
- Run
cargo clean
- Run
cargo doc
, and observe thatDocumenting <crate-name>
is printed. - Run
cargo doc --all-features
, and note thatFinished
is immediately printed.
Possible Solution(s)
Changing the presence/absence of the --all-features
flag should cause cargo doc
to rebuild the docs for at least the current crate. A simple approach would be to rebuild docs for the entire dependency tree - a more sophisticated approach would be to only rebuild docs for crates dependencies affected by the changed features (e.g. dependencies that end up getting their enabled features changed as well).
Notes
Output of cargo version
: cargo 1.39.0-nightly (22f7dd049 2019-08-27)