Skip to content

doc(hidden) stopped working in binary crates #67851

Closed
@dtolnay

Description

@dtolnay

rust-lang/cargo#7593 seems relevant. cc @LukasKalbertodt @Eh2406

If I have the following binary crate, cargo doc on stable 1.40.0 will correctly show g and not f, while beta will show both despite f being doc(hidden).

#[doc(hidden)]
pub fn f() {}
pub fn g() {}
fn main() {}

I understand that we want private things documented for bin crates, but I am labeling this a regression because this makes it impossible for macro-generated code to hide distracting implementation details that might overwhelm the actual useful API of the generated code.

I would like to suggest continuing to leave doc(hidden) items out of bin crate documentation as the default behavior of cargo doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions