Skip to content
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

Prepare bootstrapping priv-by-default struct fields #8609

Closed

Conversation

alexcrichton
Copy link
Member

It seemed that the general consensus in #8122 was that struct fields should be private by default.

I had the brilliant idea to forbid pub on struct fields, so right now this change can't bootstrap. To get around this, I'm modifying it such that the next snapshot compiler will completely disregard all visibility qualifiers on fields of structs. That way after the next snapshot I can rampage through and swap out all the pub/priv qualifiers.

After this there's only one use-case of priv, and that's just making enum variants private in an otherwise public enum. I feel like this could be emulated with other semantics, just not as nicely, but regardless I think that struct fields should be private by default.

@graydon
Copy link
Contributor

graydon commented Aug 19, 2013

Oh hmn I don't think this got anywhere close to broad consensus. It's a pretty broad change and I ... am not sure I'm into it. Modules do decent privacy control already and I'd hate to push people towards writing get/set methods everywhere when a simple field access will do.

@alexcrichton
Copy link
Member Author

Oh sure, closing this because it's better discussed in the issue rather than on a pull request.

@alexcrichton alexcrichton deleted the struct-priv-by-default branch August 19, 2013 07:28
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