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

Say that pub(in path) can't depend on use statements #1559

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/visibility-and-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ expressions, types, etc.
In addition to public and private, Rust allows users to declare an item as
visible only within a given scope. The rules for `pub` restrictions are as
follows:
- `pub(in path)` makes an item visible within the provided `path`. `path` must
be an ancestor module of the item whose visibility is being declared.
- `pub(in path)` makes an item visible within the provided `path`.
`path` must be a simple path which resolves to an ancestor module of the item whose visibility is being declared.
Each identifier in `path` must refer directly to a module (not to a name introduced by a `use` statement).
- `pub(crate)` makes an item visible within the current crate.
- `pub(super)` makes an item visible to the parent module. This is equivalent
to `pub(in super)`.
Expand Down