-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
You mentioned that trait items are public by default. Can I make a trait item private? |
you can't, at least currently, we don't use |
@@ -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 |
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.
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)
}
Looks like @petrochenkov 's feedback needs to be addressed. |
done. |
@bors r+ rollup |
📌 Commit e095c71 has been approved by |
minor fix about visibility in reference
minor fix about visibility in reference
⌛ Testing commit e095c71 with merge 69aa86a... |
💔 Test failed - auto-mac-64-opt-rustbuild |
@bors: retry |
⌛ Testing commit e095c71 with merge dea9316... |
💔 Test failed - auto-mac-64-opt-rustbuild |
@bors: retry
…On Fri, Dec 16, 2016 at 7:57 AM, bors ***@***.***> wrote:
💔 Test failed - auto-mac-64-opt-rustbuild
<https://buildbot.rust-lang.org/builders/auto-mac-64-opt-rustbuild/builds/3276>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#38215 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95LDM-RmA4rFp3im_A-ycSxBaYA7kks5rIrTmgaJpZM4LGU5m>
.
|
minor fix about visibility in reference
@bors retry |
@bors: retry |
minor fix about visibility in reference
Rollup of 29 pull requests - Successful merges: #37761, #38006, #38131, #38150, #38158, #38171, #38208, #38215, #38236, #38245, #38289, #38302, #38315, #38346, #38388, #38395, #38398, #38418, #38432, #38451, #38463, #38468, #38470, #38471, #38472, #38478, #38486, #38493, #38498 - Failed merges: #38271, #38483
No description provided.