Skip to content

Commit

Permalink
Say explicitly that pub(in path) must use a canonical path
Browse files Browse the repository at this point in the history
Arbitrary path expressions aren't allowed here (in particular, the path
can't rely on another `use` statement).
  • Loading branch information
mattheww committed Aug 4, 2024
1 parent 8c789ff commit 2cf1f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/visibility-and-privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ 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 the canonical path of an ancestor module of the item whose visibility is being declared.
- `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

0 comments on commit 2cf1f64

Please sign in to comment.