rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.14k stars 12.69k forks source link

Hide `#[repr(transparent)]` where the field is non-public #90435

Closed jhpratt closed 1 year ago

jhpratt commented 3 years ago

Per @dtolnay in #72841:

Note that repr(transparent) is not the same as permission to inspect or manipulate the internal representation of a type. That permission only exists if the field is also exposed as pub.

As such, we should consider hiding #[repr(transparent)] when the field is not otherwise visible. This should not be the case when --document-private-items is passed for reasons that should be obvious.

This will affect some stdlib structs such as NonZeroU8

@rustbot label +A-docs +C-enhancement +T-rustdoc

fmease commented 1 year ago

Seems like I misinterpreted your comment. I'm gonna pick up the work on it again then.

fmease commented 1 year ago

I've now opened #115439.