rustdoc: Add a warning if a link starts with #
and could be an intra-doc link
#76546
Labels
A-intra-doc-links
Area: Intra-doc links, the ability to link to items in docs by name
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
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
orself
, 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 - otherwiseself
andSelf
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.The text was updated successfully, but these errors were encountered: