Skip to content

rustdoc: terse diagnostic on malformed intra-doc link (single instead of double colon) #141095

Open
@sanbox-irl

Description

@sanbox-irl

Problem

I wrote:

[\`TextManager:atlases\`]

but I meant to write TextManager::atlases

The error I got was:

warning: unresolved link to `TextManager:atlases`

But a better error (for my case) would have been referencing that I was missing a semicolon.

Proposed Solution

Since I believe any item cannot have a single : in it, I propose the error should just lint for any illegal characters in a path.

I understand this might be more complex because of partial paths, but I am not familiar enough with those to address them here.

Notes

No response

Activity

weihanglo

weihanglo commented on May 16, 2025

@weihanglo
Member

This is a rustdoc issue, let me transfer this for you.

@rustbot transfer rust-lang/rust

transferred this issue fromrust-lang/cargoon May 16, 2025
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on May 16, 2025
added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
A-diagnosticsArea: Messages for errors, warnings, and lints
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 it if it has been sufficiently triaged.
on May 16, 2025
changed the title [-]`doc` should report errors for mangled types[/-] [+]rustdoc: terse diagnostic on malformed intra-doc link (single instead of double colon)[/+] on May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-feature-requestCategory: A feature request, i.e: not implemented / a PR.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

        Participants

        @weihanglo@sanbox-irl@jieyouxu@rustbot

        Issue actions

          rustdoc: terse diagnostic on malformed intra-doc link (single instead of double colon) · Issue #141095 · rust-lang/rust