Skip to content

intra-doc-link resolution failures should not be reported for cross-crate re-exports #56922

Closed
@euclio

Description

@euclio
Contributor

Discovered in #56693.

Currently, if a crate re-exports an item from another crate with resolution failures, then those resolution failures get reported for the original crate. 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.

As of this writing, std::io::Error has an intra-link resolution failure in one of its impls. So, the following code triggers the issue.

use std::io::Error;

A fix for this issue should take care to still report failures for re-exports within the same crate.

cc #43466

Activity

added a commit that references this issue on Dec 21, 2018

Rollup merge of rust-lang#56941 - euclio:deny-libstd-resolution-failu…

570a2ce
added a commit that references this issue on Dec 21, 2018

Rollup merge of rust-lang#56941 - euclio:deny-libstd-resolution-failu…

652e138
added a commit that references this issue on Dec 22, 2018

Rollup merge of rust-lang#56941 - euclio:deny-libstd-resolution-failu…

ef6ce65
added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by name
on Jan 26, 2019
added a commit that references this issue on May 20, 2019

Rollup merge of rust-lang#60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC

a34dae3
Assaf1978-boop

Assaf1978-boop commented on Feb 16, 2020

@Assaf1978-boop
jyn514

jyn514 commented on Jun 12, 2020

@jyn514
Member

Interesting, I was about to implement the opposite in #73101. I assume you'd still want the warning for additional documentation on the re-export?

// crate a

// this will emit a warning when documenting a
/// [`BrokenLinkA`]
pub struct S;

// crate b

// this will give a warning for `BrokenLinkB`, but not for `BrokenLinkA`
/// Additional context: [`BrokenLinkB`]
pub use a::S;
euclio

euclio commented on Jun 23, 2020

@euclio
ContributorAuthor

Yes, that seems reasonable to me. The goal here is to avoid reporting warnings to downstream crates that have no way to fix them.

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intra-doc-linksArea: Intra-doc links, the ability to link to items in docs by nameT-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

        Participants

        @euclio@jonas-schievink@jyn514@Assaf1978-boop

        Issue actions

          intra-doc-link resolution failures should not be reported for cross-crate re-exports · Issue #56922 · rust-lang/rust