Stream: rustdoc

Topic: `#[doc(hidden)]` and `pub use`


view this post on Zulip Daniel Henry-Mantilla (Dec 26 2020 at 10:19):

This came up in another thread; basically it would be quite desirable to have #[doc(hidden)] not (always) infect a pub usere-exported item; That is, given some #[doc(hidden)] pub … item …:

Know that this is not just a theoretical discussion: having some ability to pub use re-export and expose a public hidden item somewhere is the fastest way to be able to feature module-scoped macros in some crate:

pub mod some_path {
    #[doc(hidden)] #[macro_export]
    macro_rules! m { /* … */ }

    // #[doc(inline)]
    pub use crate::m;
}

Last updated: Oct 11 2021 at 22:34 UTC