-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Suggest making private tuple struct field public #106579
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @Nilstrieb (rustbot has picked a reviewer for you, use r? to override) |
/// Span of the privacy modifier in fields of an item `DefId` accessible with dot syntax. | ||
/// Used for hints during error reporting. | ||
field_visibility_spans: FxHashMap<DefId, Vec<Span>>, | ||
|
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.
Would it make sense to extend and reuse the field_names
field for this?
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.
field_names
only had the Symbol
and I wasn't sure if there was any place that relied on it being always a Vec
, causing perf impact if needing to map/collect it every time. But yes, we could do that :)
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.
The only difference I see is that this approach will only store the privacy span vec for tuple structs and nothing else.
a6c6886
to
9369bfa
Compare
* Account for `struct S(pub(super)Ty);` in suggestion * Suggest changing field visibility in E0603 too
@bors r+ |
Suggest making private tuple struct field public Fix rust-lang#52144.
Rollup of 6 pull requests Successful merges: - rust-lang#105806 (Support eager subdiagnostics again) - rust-lang#106322 (Handle inference variables in `CollectAllMismatches` correctly) - rust-lang#106579 (Suggest making private tuple struct field public) - rust-lang#106714 (remove unreachable error code `E0490`) - rust-lang#106751 (Fix rendering 'const' in header for intrinsics) - rust-lang#106761 (Add `WaffleLapkin` to compiler reviewers) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fix #52144.