-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustdoc: Don't distinguish structs and tuple structs with only private fields #38101
Comments
Yes, it is time, because the relevant part of #35626 is stable in nightly. |
Triage: this bug still reproduces |
This bug still reproduces, in case you were wondering. |
Yeah, it's always bothered me that tuple structs with all private fields show how many fields they have, even though they're supposed to be fully private. |
Bonus points if you make it so that it has the struct-field syntax if there are a mix of private/public fields, e.g. |
In that case, I think I might make it look like |
The main benefit of the struct-based syntax is that it's actually valid Rust syntax, but if you don't care about that, the latter also works. I don't believe that there's any tuple-based syntax that works like that. |
|
So, I should have clarified: |
For example,
AddrParseError
shows up aspub struct AddrParseError(_);
andIpv4Addr
shows up aspub struct Ipv4Addr { /* fields omitted */ }
I feel like all structs should show up as the latter form if all of the fields are private. It technically doesn't matter that the struct is a tuple struct if the fields are all private. It's not a huge deal but it's an inconsistency that looks off to me.
The text was updated successfully, but these errors were encountered: