Skip to content

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

Closed

Description

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?

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

Metadata

Labels

C-bugCategory: This is a bug.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