Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-crate intra-doc links broken for functions when there's a doc(hidden) full-crate reexport involved #73363

Closed
Manishearth opened this issue Jun 15, 2020 · 4 comments · Fixed by #73365
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Manishearth
Copy link
Member

Discovered in rust-lang/futures-rs#2177 (comment)

// crate main:
pub use dependency::future::{ready, Ready};

// crate dependency:

#[doc(hidden)]
pub mod __reexport {
    pub use crate::*;
}

pub mod future {
    mod ready {

        /// Link to [`ready`](function@ready)
        pub struct Ready;
        pub fn ready() {}

    }
    pub use self::ready::{ready, Ready};

}

The link to ready does not work.

@Manishearth Manishearth added the A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name label Jun 15, 2020
@Manishearth
Copy link
Member Author

The reason is that the access_levels check fails because the item is not in the map at all.

I suspect the checks for hidden are breaking things. If a mod is hidden I think we should be skipping the module entirely.

@Manishearth
Copy link
Member Author

It's unclear to me why this only happens for functions, and not structs.

@Manishearth
Copy link
Member Author

Ah, this is basically a variant of #31948 , and the fix for that (#33002) explicitly only handled types and mods.

@Manishearth
Copy link
Member Author

Fix is in #73365

@jyn514 would you be able to include that commit in your branch and a test based on the example above?

@jonas-schievink jonas-schievink added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jun 16, 2020
@bors bors closed this as completed in c2dbebd Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-intra-doc-links Area: Intra-doc links, the ability to link to items in docs by name T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants