Skip to content

Commit 5c61be6

Browse files
committed
Mention that globs import public symbols
Fixes #30954
1 parent 0486e12 commit 5c61be6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/doc/book/crates-and-modules.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,11 @@ to it as "sayings". Similarly, the first `use` statement pulls in the
567567
`ja_greetings` as opposed to simply `greetings`. This can help to avoid
568568
ambiguity when importing similarly-named items from different places.
569569
570-
The second `use` statement uses a star glob to bring in _all_ symbols from the
571-
`sayings::japanese::farewells` module. As you can see we can later refer to
570+
The second `use` statement uses a star glob to bring in all public symbols from
571+
the `sayings::japanese::farewells` module. As you can see we can later refer to
572572
the Japanese `goodbye` function with no module qualifiers. This kind of glob
573-
should be used sparingly.
573+
should be used sparingly. It’s worth noting that it only imports the public
574+
symbols, even if the code doing the globbing is in the same module.
574575
575576
The third `use` statement bears more explanation. It's using "brace expansion"
576577
globbing to compress three `use` statements into one (this sort of syntax

0 commit comments

Comments
 (0)