Skip to content

rustdoc shows self:: path in a warning when crate:: was used #94924

Closed
@WaffleLapkin

Description

@WaffleLapkin

The following code currently produces the following warning:

#![warn(rustdoc::broken_intra_doc_links)]

/// [a](crate::DoesNotExist)
pub struct Item;
warning: unresolved link to `self::DoesNotExist`
 --> src/lib.rs:3:9
  |
3 | /// [a](crate::DoesNotExist)
  |         ^^^^^^^^^^^^^^^^^^^ no item named `DoesNotExist` in module `rustdoc_why_self`
  |
note: the lint level is defined here
 --> src/lib.rs:1:9
  |
1 | #![warn(rustdoc::broken_intra_doc_links)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Note that the warning says "unresolved link to self::DoesNotExist" even though the code mentions crate::DoesNotExist

@rustbot label +T-rustdoc +A-intra-doc-links

Meta

rustdoc --version --verbose:

rustdoc 1.61.0-nightly (4ce374923 2022-02-28)
binary: rustdoc
commit-hash: 4ce3749235fc31d15ebd444b038a9877e8c700d7
commit-date: 2022-02-28
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameC-bugCategory: This is a bug.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