Skip to content

Have rustdoc document private items, except use and extern crate #27104

Closed
@SimonSapin

Description

@SimonSapin

Rustdoc defaults to only documented things that are public, i.e. things that the user of a library would care about. This is a good default, but rustdoc can also be useful to people working on large crates by documenting these crates themselves. In that case, it’s preferable to also include private types, fields, functions, and methods.
#15347 was about this use case, and was closed with this solution:

rustdoc --no-defaults --passes "collapse-docs unindent-comments"

We just tried this on http://doc.servo.org/ . It’s better than before, but has the unexpected side effect that every use item (including non-pub and the implicit prelude) and every extern crate (including the implicit std) is documented under “Reexports”. It can get pretty noisy:

screenshot from 2015-07-18 13-11-44

They’re technically part of the crate, but don’t provide useful information. Could rustdoc split up the strip-private pass into one that strips private use and extern crate, and one for everything else?

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