File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -913,10 +913,28 @@ mod match_keyword {}
913
913
//
914
914
/// Organize code into [modules].
915
915
///
916
- /// The documentation for this keyword is [not yet complete]. Pull requests welcome!
916
+ /// Use `mod` to create new [modules] to encapsulate code, including other
917
+ /// modules:
917
918
///
919
+ /// ```
920
+ /// mod foo {
921
+ /// mod bar {
922
+ /// type MyType = (u8, u8);
923
+ /// fn baz() {}
924
+ /// }
925
+ /// }
926
+ /// ```
927
+ ///
928
+ /// Like [`struct`]s and [`enum`]s, a module and its content are private by
929
+ /// default, unaccessible to code outside of the module.
930
+ ///
931
+ /// To learn more about allowing access, see the documentation for the [`pub`]
932
+ /// keyword.
933
+ ///
934
+ /// [`enum`]: keyword.enum.html
935
+ /// [`pub`]: keyword.pub.html
936
+ /// [`struct`]: keyword.struct.html
918
937
/// [modules]: ../reference/items/modules.html
919
- /// [not yet complete]: https://github.com/rust-lang/rust/issues/34601
920
938
mod mod_keyword { }
921
939
922
940
#[ doc( keyword = "move" ) ]
You can’t perform that action at this time.
0 commit comments