Skip to content

Commit 2cf1f64

Browse files
committed
Say explicitly that pub(in path) must use a canonical path
Arbitrary path expressions aren't allowed here (in particular, the path can't rely on another `use` statement).
1 parent 8c789ff commit 2cf1f64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/visibility-and-privacy.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ 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 the canonical path of an ancestor module of the item whose visibility is being declared.
152152
- `pub(crate)` makes an item visible within the current crate.
153153
- `pub(super)` makes an item visible to the parent module. This is equivalent
154154
to `pub(in super)`.

0 commit comments

Comments
 (0)