Skip to content

Commit

Permalink
Rollup merge of rust-lang#73619 - poliorcetics:mod-keyword, r=stevekl…
Browse files Browse the repository at this point in the history
…abnik

Document the mod keyword

Partial fix for rust-lang#34601 .

Documentation for the `mod` keyword.
  • Loading branch information
Manishearth committed Jun 24, 2020
2 parents f83ee17 + 9766a93 commit 1f3b2ac
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/libstd/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 1f3b2ac

Please sign in to comment.