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

Incoherent behaviour for re-exported #[doc(hidden)] items #109449

Closed
GuillaumeGomez opened this issue Mar 21, 2023 · 0 comments · Fixed by #112304
Closed

Incoherent behaviour for re-exported #[doc(hidden)] items #109449

GuillaumeGomez opened this issue Mar 21, 2023 · 0 comments · Fixed by #112304
Assignees
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Mar 21, 2023

I was able to find 3 different ways to handle re-exports of items with #[doc(hidden)]:

mod private_module {
    #[doc(hidden)]
    pub struct Public;
    #[doc(hidden)]
    pub type Bar = u32;
}

#[doc(hidden)]
pub type Bar = u32;
#[doc(hidden)]
pub fn foo() {}

#[doc(hidden)]
mod module {
    pub struct Public;
    pub type Bar = u32;
}

pub use self::private_module::Public as Foo; // doesn't appear
pub use self::private_module::Bar as Foo2; // doesn't appear
pub use crate::Bar as Yo; // re-export is displayed, but no link to `Yo`
pub use crate::foo as yo; // re-export is displayed, but no link to `foo`
pub use self::module::Public as Foo3; // inlined
pub use self::module::Bar as Foo4; // inlined

I think that for module items to be inlined, it's ok since the module and not the items are hidden.

However, the question becomes interesting for the two other cases where doc(hidden) is directly on the item: should we display the re-export in any case or not?

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 21, 2023
@GuillaumeGomez GuillaumeGomez self-assigned this Mar 21, 2023
@GuillaumeGomez GuillaumeGomez changed the title Re-export of hidden macro should be displayed Incoherent behaviour for re-exported #[doc(hidden)] items Mar 21, 2023
@bors bors closed this as completed in 9bc95a4 Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
1 participant