-
Couldn't load subscription status.
- Fork 13.9k
Closed
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
The link will be broken if the item is re-exported into a different module, see #76497 for an example. Rustdoc should recommend prefixing the link with either Self or self, depending on whether it's on a type or module.
There is a caveat here that this only works if you're documenting an item, not arbitrary # links - otherwise self and Self don't make sense. In particular rustdoc can't tell a # link from a normal link, so this would have to go after the intra-doc pass in https://github.com/rust-lang/rust/blob/master/src/librustdoc/html/markdown.rs somewhere.
Metadata
Metadata
Assignees
Labels
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameArea: Intra-doc links, the ability to link to items in docs by nameC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.