Skip to content

Types in #[doc(hidden)] module show up under trait implementations #145371

Description

@clarfonthey

Code

Example in this PR: #145335 (comment)

The wtf8 module is hidden, but the linkchecker shows that the implementations of traits for its types are not hidden, leading to dead links.

Reproduction Steps

  1. In non-hidden module, define non-hidden trait
  2. In hidden module, define a type and implement the non-hidden trait
  3. When generating documentation, the implementation of the hidden type will show up on the non-hidden trait, with a dead link

Expected Outcome

Types in hidden modules should be hidden in all cases, including trait implementations.

Workaround

Adding #[doc(hidden)] directly to the types inside the hidden module correctly hides the implementations under the trait. However, this should not be necessary, since the hidden module does not generate documentation for its items.

Version

rustdoc 1.90.0-nightly (430d6eddf 2025-07-25)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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