Skip to content

rustdoc should hide private members in a const definition #113768

Closed
@alexkazik

Description

@alexkazik

When re-exporting a struct from another crate which has private fields and constant(s) then the "value" of the constants are printed in rustdoc.

Original documentation of the external crate (as expected):

pub const ZERO: Scientific = _

I tried this code:

pub use scientific::Scientific;

I expected to see this happen: same documentation as above.

Instead, this happened:

pub const ZERO: Scientific = Scientific{ inner: Sci::ZERO,}

The general privacy of const seemed to be fixed in #32735 but not this case.

Meta

rustc --version --verbose:

binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: aarch64-apple-darwin
release: 1.71.0
LLVM version: 16.0.5

rustc 1.73.0-nightly (33a2c2487 2023-07-12)
binary: rustc
commit-hash: 33a2c2487ac5d9927830ea4c1844335c6b9f77db
commit-date: 2023-07-12
host: aarch64-apple-darwin
release: 1.73.0-nightly
LLVM version: 16.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions