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

minor fix about visibility in reference #38215

Merged
merged 2 commits into from
Dec 21, 2016
Merged

minor fix about visibility in reference #38215

merged 2 commits into from
Dec 21, 2016

Conversation

liigo
Copy link
Contributor

@liigo liigo commented Dec 7, 2016

No description provided.

@rust-highfive
Copy link
Collaborator

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@KalitaAlexey
Copy link
Contributor

You mentioned that trait items are public by default. Can I make a trait item private?

@liigo
Copy link
Contributor Author

liigo commented Dec 7, 2016

you can't, at least currently, we don't use priv keyword any more.

@@ -1730,7 +1730,8 @@ of an item to see whether it should be allowed or not. This is where privacy
warnings are generated, or otherwise "you used a private item of another module
and weren't allowed to."

By default, everything in Rust is *private*, with one exception. Enum variants
By default, everything in Rust is *private*, with two exceptions: Associated
items of a Trait are public by default; Enum variants
Copy link
Contributor

@petrochenkov petrochenkov Dec 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Associated items and variants are not public by default, they inherit visibility from their traits and enums respectively. E.g.

pub(vis) trait Tr {
    fn f();
}

is "desugared" into

pub(vis) trait Tr {
    pub(vis) fn f(); // (Not syntactically legal now)
}

@steveklabnik
Copy link
Member

Looks like @petrochenkov 's feedback needs to be addressed.

@liigo
Copy link
Contributor Author

liigo commented Dec 13, 2016

done.

@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 13, 2016

📌 Commit e095c71 has been approved by petrochenkov

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 15, 2016
minor fix about visibility in reference
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 16, 2016
minor fix about visibility in reference
@bors
Copy link
Contributor

bors commented Dec 16, 2016

⌛ Testing commit e095c71 with merge 69aa86a...

@bors
Copy link
Contributor

bors commented Dec 16, 2016

💔 Test failed - auto-mac-64-opt-rustbuild

@GuillaumeGomez
Copy link
Member

@bors: retry

@bors
Copy link
Contributor

bors commented Dec 16, 2016

⌛ Testing commit e095c71 with merge dea9316...

@bors
Copy link
Contributor

bors commented Dec 16, 2016

💔 Test failed - auto-mac-64-opt-rustbuild

@alexcrichton
Copy link
Member

alexcrichton commented Dec 16, 2016 via email

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 18, 2016
minor fix about visibility in reference
@sanxiyn
Copy link
Member

sanxiyn commented Dec 19, 2016

@bors retry

@alexcrichton
Copy link
Member

@bors: retry

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
minor fix about visibility in reference
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit e095c71 into rust-lang:master Dec 21, 2016
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.

9 participants