Skip to content

"Aliased Type" of a type alias to a struct with a hidden public field is missing /* private fields */ #144969

@kpreid

Description

@kpreid

Code

This reproduction needs two crates. Crate 1:

pub struct Foo {
    pub a: bool,
    #[doc(hidden)]
    pub b: bool,
}

Crate 2:

pub type Foo = crate_1::Foo;
fn main() {}

Or, to use public crates.io crates, make a type alias to euclid::Point3D.

Reproduction Steps

cargo doc then visit crate_2::Foo's documentation.

Expected Outcome

The “Aliased Type” of crate_2::Foo is identical to crate_1::Foo.

Actual Output

crate_1::Foo has a /* private fields */ marker in the struct display, but crate_2::Foo does not.

Version

rustdoc 1.91.0-nightly (0060d5a 2025-08-04)
rustdoc 1.89.0 (2948388 2025-08-04)

Additional Details

Necessary ingredients to reproduction are that:

  • The field is hidden, not private
  • The alias is in a different crate than the struct

@rustbot label +A-rustdoc-ui

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateA-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions