Support intra-doc linking to `()`
Open
Nobody has claimed this yet.
A-intra-doc-links
C-bug
T-rustdoc
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
//! [`()`] is the best type ever!
Expected Outcome
A link to the unit type.
Actual Output
Dead link appearing as "[()]".
Version
rustdoc 1.89.0 (29483883e 2025-08-04)
rustdoc 1.91.0-nightly (0060d5a2a 2025-08-04)
Additional Details
The link can be written as [`()`][primitive@unit] but I think this should not be necessary, since () is an unambiguous, non-generic type name.
@rustbot label +A-intra-doc-links
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 issue's rustdoc example containing [()] and compare it with the explicit primitive@unit form. Trace how rustdoc resolves intra-doc links to primitive types, then verify that the shorthand resolves to the unit type and no longer renders as a dead link.
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
- Clearly specified
- Newbie friendliness
- 45/100