Skip to content

rustdoc: doc(hidden) also hides re-exports #59368

Closed
@ghost

Description

Code:

#[macro_use]
pub mod my_module {
    /// This is a simple macro.
    #[macro_export]
    #[doc(hidden)]
    macro_rules! foo {
        () => ();
    }

    /// This doc comment doesn't show up in rustdoc (there's just an ugly re-export).
    pub use crate::foo as bar;

    // And this re-export doesn't show up in rustdoc at all!
    #[doc(inline)]
    pub use crate::foo as baz;
}

Generated docs:

screenshot

So what I want to do is create a macro inside my_module. I don't want it to show up in crate root - I want it only in this module.

Both of the re-exports above work just fine. However, in the generated docs, one of them has no docs and the other doesn't show up at all.

I'm surprised that #[doc(hidden)] is "recursive" - shouldn't it only hide foo and not hide baz? Is this a bug?

Versions:

$ rustc --version
rustc 1.35.0-nightly (94fd04589 2019-03-21)
$ cargo --version
cargo 1.35.0-nightly (0e35bd8af 2019-03-13)
$ rustdoc --version
rustdoc 1.35.0-nightly (94fd04589 2019-03-21)

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