Types in `#[doc(hidden)]` module show up under trait implementations
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
Example in this PR: https://github.com/rust-lang/rust/pull/145335#issuecomment-3182304585
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
- In non-hidden module, define non-hidden trait
- In hidden module, define a type and implement the non-hidden trait
- 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported case with rustdoc or cargo doc: a non-hidden trait implemented for a type in a #[doc(hidden)] module. Inspect the generated trait documentation and linkchecker results. Done means the hidden type's trait implementation no longer appears publicly or produces a dead link, without requiring #[doc(hidden)] on the type itself.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100