rust-lang / rust-lang/rust

Warn for intra-doc links to `doc(hidden)` items.

Open
#144,664 0 comments 0 reactions 1 assignee View on GitHub

@lolbinarycat is already working on this.

Since Jul 31, 2025.

A-intra-doc-links A-lints C-bug T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

pub mod foo {
    /// See also [`crate::bar::bun`].
    /// See also [`bar::bun`][crate::bar::bun].
    /// See also [`bar::bun`](crate::bar::bun).
    pub fn fun() {}
}

#[doc(hidden)]
pub mod bar {
    pub fn bun() {}
}

Reproduction Steps

cargo doc

Expected Outcome

There should be warnings for all of the broken links.

If the item is private instead of hidden, there are currently three private_intra_doc_links warnings. Hidden items should be treated similarly to private ones.

Actual Output

No warnings. The first two links appear as unprocessed brackets, and the last one has crate::bar::bun as a URL.

Version

rustdoc 1.90.0-nightly (498ae9fed 2025-07-28)

@rustbot label +A-intra-doc-links +A-lints
cc @lolbinarycat who seems to be interested in intra-doc link linting.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.