Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the mod keyword #73619

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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