rust-lang / rust-lang/rust

[CODE IMPROVEMENT] handle `doc(hidden)` differently in rustdoc

Open
#129,415 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-cleanup T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Currently, the handle of doc(hidden) in rustdoc is very complex and needs to go through multiple strip passes which are all very fine-tuned, making the whole very fragile and difficult to keep up with.

Instead of these passes, we could instead check whether or not an item is doc hidden directly when rendering them. With a top-down approach, if an item is doc(hidden), none of its children will be rendered either.

Gonna give it a try in the few weeks to see how much of it is actually doable.

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

The issue does not name specific files, tests, or entry points; begin by tracing rustdoc's current handling of doc(hidden) and its multiple strip passes. Define the top-down rendering behavior and verify that hidden items and their children are consistently excluded without the existing fragile passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.