Skip to content

Consider warning when intra-doc links fail on a cross-crate re-export #77200

Closed
@jyn514

Description

@jyn514

This is the exact opposite of #56922 😆

There have been a lot of silent failures popping up WRT cross-crate re-exports (#77193, #75855, #76106), and they're hard to notice because the failure is completely swallowed, you have to manually inspect the generated docs.

The rationale in #56922 was that

Since the downstream crate has no way to fix the resolution failure in the upstream crate, it shouldn't be reported, much like capping lints.

This is only true if the failure existed in the upstream crate. If it only appears on the re-export, it will fail completely silently for both the original crate and the current one. This is especially bad when you're adding additional docs on the re-export:

/// [broken_link]
pub use std::string::String;

It could also appear for things outside of the control of the new crate, though: #75855

I think it also makes sense to warn for rustdoc bugs, since otherwise the user never knows to report them and we can't fix them.

@rust-lang/rustdoc what do you think?

cc @euclio

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameI-needs-decisionIssue: In need of a decision.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