Skip to content

Why do I have access to a private member? #14358

Closed Answered by mockersf
bbasics asked this question in Q&A
Discussion options

You must be logged in to vote

from https://doc.rust-lang.org/reference/visibility-and-privacy.html

If an item is private, it may be accessed by the current module and its descendants.

private is not private to the current module, you should put it in another if you want it to fail compilation

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bbasics
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants