-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
rustdoc: Document #[repr(transparent)] for rustc_pub_transparent
#150931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
rustbot has assigned @GuillaumeGomez. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was also taking a look at the issue already and had half of the same code written :)
Looks good to me
| // – 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That goes against what the comment just above is describing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That guarantee is in the prose of each type's docs, however - not from publicising the repr attribute.
8bff0dc to
1256a9a
Compare
Fixes #150919