Skip to content

[rustdoc] Documentation not being generated for doc(inline)ed re-export of a doc(hidden) item in another crate #123435

Closed
@AhmadAlHallak

Description

@AhmadAlHallak

Suppose we have crates a, and b (crate b being a nested crate within crate a), and we have the following in a/b/src/lib.rs:

#[doc(hidden)]
pub struct HiddenInCrateB;

and then in a/src/lib.rs:

/// Docs that I think should be generated for an inlined re-export of `b::DocHiddenInB` but are not
#[doc(inline)]
pub use b::HiddenInCrateB;

mod c {
    #[doc(hidden)]
    pub struct HiddenInModuleC;
}
/// Docs that are generated for an inlined re-export of `c::HiddenInModuleC`
#[doc(inline)]
pub use c::HiddenInModuleC;

and then run cargo doc and open the generated documentation for crate a we would see an entry HiddenInModuleC but not for HiddenInCrateB

I expected documentation to be generated for both HiddenInModuleC and HiddenInCrateB, or alternatively no docs being generated for either.

Meta

rustc --version --verbose:

rustc 1.77.1 (7cf61ebde 2024-03-27)
binary: rustc
commit-hash: 7cf61ebde7b22796c69757901dd346d0fe70bd97
commit-date: 2024-03-27
host: x86_64-pc-windows-msvc
release: 1.77.1
LLVM version: 17.0.6
### Tasks

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