Skip to content

Commit 47faeb9

Browse files
committed
[docs] Note that types and modules share the same namespace
1 parent 0afe002 commit 47faeb9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/rust.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,10 @@ mod math {
752752
}
753753
~~~~~~~~
754754

755+
Modules and types share the same namespace.
756+
Declaring a named type that has the same name as a module in scope is forbidden:
757+
that is, a type definition, trait, struct, enumeration, or type parameter
758+
can't shadow the name of a module in scope, or vice versa.
755759

756760
#### View items
757761

0 commit comments

Comments
 (0)