Warn for intra-doc links to `doc(hidden)` items.
Open
@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
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.
Assessment
This issue has not been assessed yet.