Skip to content

rustdoc: improve attribute span handling in diagnostics #150735

Closed

Description

@folkertdev

In #150721 intra-doc links are rendered for deprecation notes.

Currently the span that is used when reporting an error (e.g. the link cannot be resolved) is a bit too broad. A span containing all doc comments and the deprecated attribute is used as a fallback.

Error reporting would improve slightly if just the span of the deprecation note would be used. That requires that that span is stored, and then used in report_diagnostic.

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 6, 2026
  2. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by name
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 6, 2026
  3. GuillaumeGomez commented on Jan 20, 2026

    @GuillaumeGomez
    Member

    Fixed in #150721.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameT-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