Skip to content

Conversation

@clubby789
Copy link
Contributor

@clubby789 clubby789 commented Jan 10, 2026

Fixes #150919

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jan 10, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2026

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Contributor

@JonathanBrouwer JonathanBrouwer left a 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

View changes since this review

// – 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(_)) {
Copy link
Member

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.

Copy link
Member

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. ^^'

Copy link
Contributor Author

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

Copy link
Contributor

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.

@clubby789 clubby789 force-pushed the doc-rustc-pub-transparent branch from 8bff0dc to 1256a9a Compare January 10, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#[rustc_pub_transparent] does not shows up as #[repr(transparent)] in docs

6 participants