Skip to content

rustdoc: document-private-items makes aliased types expansion see through private fields #123860

Closed
@mrnossiom

Description

@mrnossiom

Using cargo doc --document-private-items to document private types of the current workspace exposes external types private implementation details (in this case private fields). I would expect the expansion to limit itself to public fields.

e.g.

type PrivateType = Vec<String>;

gives


image


Quick repo

Meta

rustc --version --verbose

rustc 1.79.0-nightly (a07f3eb43 2024-04-11)
binary: rustc
commit-hash: a07f3eb43acc5df851e15176c7081a900a30a4d7
commit-date: 2024-04-11
host: x86_64-unknown-linux-gnu
release: 1.79.0-nightly
LLVM version: 18.1.3

r? @GuillaumeGomez

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions