Skip to content

Stance on the API compatibility of #[doc(hidden)] pub items #15863

@ROMemories

Description

@ROMemories

The #[doc(hidden)] attribute allows to hide items from the rendered documentation generated by rustdoc (with some subtleties regarding re-exports).

It is my opinion that this excludes the decorated item from the crate's SemVer commitment.
This opinion seems to be shared by rust-analyzer, where such items have been excluded from the auto-completion mechanism (rust-lang/rust-analyzer#9719, rust-lang/rust-analyzer#15473). Additionally, cargo-semver-checks also worked on taking into account this attribute when checking for breaking changes.

However, the Cargo reference regarding SemVer only states that removing/renaming pub items is a major change, making no difference for #[doc(hidden)] items.

Is there an official stance on the compatibility guarantees of #[doc(hidden)] pub items and, if so, should the reference be updated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-documenting-cargo-itselfArea: Cargo's documentationA-semverArea: semver specifications, version matching, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions