Skip to content

improved help message for rustdoc::broken_intra_doc_links #132788

Open
@lolbinarycat

Description

@lolbinarycat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions