Skip to content

rustdoc: --no-deps does not rebuild documentation #15728

@connortsui20

Description

@connortsui20

I noticed that when I run cargo doc --no-deps after I have already built documentation with dependencies, it does not leave out the dependencies. I feel like this is probably not intended behavior and looking online I can't find anything that says this is correct.

Reproduction Steps

Simply run cargo doc, and then run cargo doc --no-deps, and there is no difference.

Expected Outcome

I would have expected that the docs would be rebuilt to include no dependencies.

Actual Output

This behavior is not really intuitive because the similar --document-private-items flag does rebuild the documentation if the current version has a different setting.

Version

rustdoc 1.88.0 (6b00bc388 2025-06-23)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-documenting-cargo-itselfArea: Cargo's documentationC-bugCategory: bugCommand-docS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions