rust-lang / rust-lang/rust

improved help message for rustdoc::broken_intra_doc_links

Open
#132,788 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently, the only suggestion rustdoc gives is to simply escape [ and ] with backslashes, or if there is a similarly-named item, to link to that instead.

there are a few other common errors that it could catch though:

  • code snippets (like arr[idx+3]) should be surrounded by backticks instead of escaping each bracket individually
  • if there is a similarly-named link reference definition, it should suggest referencing that (probable typo)
  • if the type that is being linked to is outside the current documentation bundle (e.g. linking to a type in an alternative library for the purpose of comparison, or linking to a non-rust type), then it should recommend adding a link definition item.

inspired by discussion on #132748

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 with the rustdoc::broken_intra_doc_links diagnostic and the discussion in #132748. Review how its current escaping and similarly named-item suggestions are produced, then cover the three listed cases with appropriate guidance. Done means rustdoc offers targeted suggestions for code snippets, link reference definitions, and types outside the current documentation bundle.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.