Skip to content

rustdoc: Render private fields in tuple struct as /* private fields */#115604

Merged
bors merged 2 commits intorust-lang:masterfrom
GuillaumeGomez:private-fields-tuple-struct
Sep 8, 2023
Merged

rustdoc: Render private fields in tuple struct as /* private fields */#115604
bors merged 2 commits intorust-lang:masterfrom
GuillaumeGomez:private-fields-tuple-struct

Conversation

@GuillaumeGomez
Copy link
Member

Reopening of #110552. All that was missing was a test for the different cases so I added it into the second commit.

Description from the original PR:

I've gotten some feedback that the current rustdoc rendering of...

struct HasPrivateFields(_);

...is confusing, and I agree with that feedback, especially compared to the field struct case:

struct HasPrivateFields { /* private fields */ }

So this PR makes it so that when all of the fields of a tuple variant are private, just render it with the /* private fields */ comment. We can't always render it like that, for example when there's a mix of private and public fields.

cc @jsha
r? @notriddle

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants