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

Finer-grained privacy control #482

Closed
aturon opened this issue Nov 25, 2014 · 7 comments
Closed

Finer-grained privacy control #482

aturon opened this issue Nov 25, 2014 · 7 comments

Comments

@aturon
Copy link
Member

aturon commented Nov 25, 2014

Rust has a reasonable default meaning of pub and private items, but for larger projects it would be extremely useful to have finer-grained control -- especially "public to crate, private to world".

@aturon
Copy link
Member Author

aturon commented Nov 25, 2014

cc @carllerche

@Valloric
Copy link

"public to crate, private to world"

So something like C#'s internal access modifier?

@kud1ing
Copy link

kud1ing commented Nov 26, 2014

So something like C#'s internal access modifier?

Also reminds me of Swift's internal, but C# was probably first.

@aturon
Copy link
Member Author

aturon commented Nov 26, 2014

Something like internal would be nice, but I think @nikomatsakis has some ideas about a more expressive notion of pub that takes a path parameter (and subsumes internal).

@nodakai
Copy link

nodakai commented Nov 26, 2014

+1, but I hope we can avoid a mess like in Java:

Modifier Class Package Subclass World
public Y Y Y Y
protected Y Y Y N
no modifier Y Y N N
private Y N N N

Also, I wonder if something like "protected" trait methods might be useful. They are visible, across crates, only to implementations of other trait methods of the same/child trait.

@Stebalien
Copy link
Contributor

Triage: Fixed by #1422

@steveklabnik
Copy link
Member

Yup!

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

No branches or pull requests

6 participants