Skip to content

Improve error messages for intra-doc links when there are backticks #87169

Closed
@GuillaumeGomez

Description

@GuillaumeGomez

In #87078, we arrived at the following situation:

error: incompatible link kind for `Foo::bar`
  --> $DIR/field-ice.rs:5:6
   |
LL | /// [`Foo::bar()`]
   |      ^^^^^^^^^^^^ help: to link to the field, remove the disambiguator: ``Foo::bar``

I want to underline this part in particular:

``Foo::bar``

Having two backticks is very weird. What I suggest instead is to reduce the "^^^^^" underlining part in order to not include backticks in it so then they can be removed from the error message as well, which would give:

error: incompatible link kind for `Foo::bar`
  --> $DIR/field-ice.rs:5:6
   |
LL | /// [`Foo::bar()`]
   |       ^^^^^^^^^^ help: to link to the field, remove the disambiguator: `Foo::bar`

I'll do it in the next days if no one does until then. :)

cc @jyn514

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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