Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WaffleLapkin opened this issue Mar 14, 2022 · 1 comment · Fixed by #95337
Closed

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

WaffleLapkin opened this issue Mar 14, 2022 · 1 comment · Fixed by #95337
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@WaffleLapkin
Copy link
Member

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
@WaffleLapkin WaffleLapkin added the C-bug Category: This is a bug. label Mar 14, 2022
@rustbot rustbot added A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 14, 2022
@petrochenkov
Copy link
Contributor

Fixed in #95337.

@bors bors closed this as completed in 949b98c Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants