rust-lang / rust-lang/rust

Support intra-doc linking to `()`

Open
#144,937 1 comment 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.