Skip to content

Warn on using intra-doc links on stable #63305

Closed
@abonander

Description

@abonander

It would be a significant effort to implement feature-gates in Rustdoc just for intra-doc links so I understand why that hasn't been done.

However, because there is no warning I've been unintentionally creating docs with broken links on stable for a while now. I haven't observed this myself because I prefer nightly compilers and assume it works on stable if there's no feature flags, and docs.rs uses a nightly compiler as well so published docs work fine. It should be relatively easy to produce this warning on stable as most of the same logic already exists to tell the difference between a real URL and an item path: https://github.com/rust-lang/rust/blob/master/src/librustdoc/passes/collect_intra_doc_links.rs#L277

This has caught at least one other user by surprise as well: https://www.reddit.com/r/rust/comments/cm7rhv/hey_rustaceans_got_an_easy_question_ask_here/ew0nvo2/?context=1000

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameA-stabilityArea: `#[stable]`, `#[unstable]` etc.C-enhancementCategory: An issue proposing an enhancement or a PR with one.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