rust-lang / rust-lang/rust

rustdoc: reexports of hidden items are not hidden, and look confusing

Open
#130,322 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-local-reexports A-rustdoc-search C-bug S-has-mcve T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I tried searching for the (unstable) Receiver trait in the standard library. The only result it links to is this:

image

I would expect this to be clickable or have some other way for me to look at the actual definition of this trait. But nothing, the story just ends here.

Looking at the trait, I noticed this:

#[doc(hidden)]
pub trait Receiver {
    // Empty.
}

So probably the doc(hidden) is why we don't get a link. But shouldn't rustdoc then also hide the reexport?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the standard-library search for Receiver and inspect rustdoc's handling of the #[doc(hidden)] trait and its reexport.Receiver entry. Done means the generated documentation no longer exposes a non-clickable reexport for the hidden item, with a regression check for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.