Skip to content

Hidden items in external crate are made public when inline glob re-exported  #53417

Closed
@SergioBenitez

Description

@SergioBenitez

Consider a crate parent with the following items:

mod module;

#[doc(hidden)]
pub use module::Hidden;
pub use module::Visible;

where module.rs contains:

pub enum Hidden {  }
pub enum Visible {  }

Now consider a crate foo that inline, glob-exports parent in a module par:

extern crate parent;

pub mod par {
    #[doc(inline)]
    pub use parent::*;
}

The item Hidden is rendered in the rustdocs for foo::par when it shouldn't be.

To work around this issue, #[doc(hidden)] can be applied to the Hidden item in module.rs:

#[doc(hidden)]
pub enum Hidden {  }
pub enum Visible {  }

This workaround only works when #[doc(hidden)] is applied to the source definition.

cc @QuietMisdreavus

Metadata

Metadata

Assignees

No one assigned

    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