diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-06-22 15:36:09 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-06-22 15:36:09 +0200 |
| commit | 9766a93163cfb1447e4e7c4f9a516c77257b54be (patch) | |
| tree | 978ad8a9139d80ac4c8f38f407794a68c6605723 /src/libstd | |
| parent | 1a4e2b6f9c75a0e21722c88a0e3b610d6ffc3ae3 (diff) | |
| download | rust-9766a93163cfb1447e4e7c4f9a516c77257b54be.tar.gz rust-9766a93163cfb1447e4e7c4f9a516c77257b54be.zip | |
Document the mod keyword
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/keyword_docs.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs index a4996d9eee8..c966d8d34e9 100644 --- a/src/libstd/keyword_docs.rs +++ b/src/libstd/keyword_docs.rs @@ -913,10 +913,28 @@ mod match_keyword {} // /// Organize code into [modules]. /// -/// The documentation for this keyword is [not yet complete]. Pull requests welcome! +/// Use `mod` to create new [modules] to encapsulate code, including other +/// modules: /// +/// ``` +/// mod foo { +/// mod bar { +/// type MyType = (u8, u8); +/// fn baz() {} +/// } +/// } +/// ``` +/// +/// Like [`struct`]s and [`enum`]s, a module and its content are private by +/// default, unaccessible to code outside of the module. +/// +/// To learn more about allowing access, see the documentation for the [`pub`] +/// keyword. +/// +/// [`enum`]: keyword.enum.html +/// [`pub`]: keyword.pub.html +/// [`struct`]: keyword.struct.html /// [modules]: ../reference/items/modules.html -/// [not yet complete]: https://github.com/rust-lang/rust/issues/34601 mod mod_keyword {} #[doc(keyword = "move")] |
