about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-06-25 18:00:16 -0700
committerGitHub <noreply@github.com>2020-06-25 18:00:16 -0700
commit01a293a838b0b2795249a72adde94a8b497e955f (patch)
tree550fd6d31bc0a2da89036a8d2abbe5ffc842b8f4 /src/libstd
parent0d03456163c308c8c856d1c4d9f2368eed805732 (diff)
parent9766a93163cfb1447e4e7c4f9a516c77257b54be (diff)
downloadrust-01a293a838b0b2795249a72adde94a8b497e955f.tar.gz
rust-01a293a838b0b2795249a72adde94a8b497e955f.zip
Rollup merge of #73619 - poliorcetics:mod-keyword, r=steveklabnik
Document the mod keyword

Partial fix for #34601 .

Documentation for the `mod` keyword.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/keyword_docs.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs
index 6d98c4d01c0..4d3ec5c348f 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")]