Skip to content

Change struct fields to inherit privacy of the struct #11777

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

Merged
merged 2 commits into from
Jan 26, 2014

Conversation

alexcrichton
Copy link
Member

See #11522, but the idea is for private structs to have private fields by default, whereas public structs will continue to have public fields by default.

This was the original intention of the privacy of structs, and it was
erroneously implemented before. A pub struct will now have default-pub fields,
and a non-pub struct will have default-priv fields. This essentially brings
struct fields in line with enum variants in terms of inheriting visibility.

As usual, extraneous modifiers to visibility are disallowed depend on the case
that you're dealing with.

Closes rust-lang#11522
bors added a commit that referenced this pull request Jan 26, 2014
See #11522, but the idea is for private structs to have private fields by default, whereas public structs will continue to have public fields by default.
@bors bors closed this Jan 26, 2014
@bors bors merged commit 4d6836f into rust-lang:master Jan 26, 2014
@alexcrichton alexcrichton deleted the issue-11522 branch January 26, 2014 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants