Skip to content

Commit 366c0f5

Browse files
committed
Say that pub(in path) may not rely on use statements
1 parent 8c789ff commit 366c0f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/visibility-and-privacy.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,9 @@ expressions, types, etc.
147147
In addition to public and private, Rust allows users to declare an item as
148148
visible only within a given scope. The rules for `pub` restrictions are as
149149
follows:
150-
- `pub(in path)` makes an item visible within the provided `path`. `path` must
151-
be an ancestor module of the item whose visibility is being declared.
150+
- `pub(in path)` makes an item visible within the provided `path`.
151+
`path` must be a simple path which resolves to an ancestor module of the item whose visibility is being declared.
152+
Each identifier in `path` must refer directly to a module (not to a name introduced by a `use` statement).
152153
- `pub(crate)` makes an item visible within the current crate.
153154
- `pub(super)` makes an item visible to the parent module. This is equivalent
154155
to `pub(in super)`.

0 commit comments

Comments
 (0)