Skip to content

Passing '--all-features' flag to 'cargo doc' does not trigger rebuild #7370

Closed
@Aaron1011

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

  1. Run cargo clean
  2. Run cargo doc, and observe that Documenting <crate-name> is printed.
  3. Run cargo doc --all-features, and note that Finished 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)

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions