rustdoc: Document #[repr(transparent)] for rustc_pub_transparent#150931
rustdoc: Document #[repr(transparent)] for rustc_pub_transparent#150931clubby789 wants to merge 1 commit intorust-lang:mainfrom
#[repr(transparent)] for rustc_pub_transparent#150931Conversation
|
rustbot has assigned @GuillaumeGomez. Use |
| // – in case all fields are 1-ZST fields — at least one field is public and visible. | ||
| let is_public = 'is_public: { | ||
| // `#[rustc_pub_transparent]` | ||
| if find_attr!(tcx.get_all_attrs(def_id), AttributeKind::PubTransparent(_)) { |
There was a problem hiding this comment.
That goes against what the comment just above is describing.
There was a problem hiding this comment.
I didn't mean to change the comment, I meant that it was the expected behaviour. If you want to change it, gonna need to talk with the rustdoc team first. ^^'
There was a problem hiding this comment.
Oh right. This behaviour seems reaonable to me, since it reflects the description of used internally to mark types with a "transparent" representation when it is guaranteed by the documentation
There was a problem hiding this comment.
That guarantee is in the prose of each type's docs, however - not from publicising the repr attribute.
8bff0dc to
1256a9a
Compare
Fixes #150919