File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
1+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
22// file at the top-level directory of this distribution and at
33// http://rust-lang.org/COPYRIGHT.
44//
2626///
2727/// [book]: https://doc.rust-lang.org/book/second-edition/ch03-03-how-functions-work.html
2828mod fn_keyword { }
29+
30+ #[ doc( keyword = "let" ) ]
31+ //
32+ /// The `let` keyword.
33+ ///
34+ /// The `let` keyword is used to declare a variable.
35+ ///
36+ /// Example:
37+ ///
38+ /// ```rust
39+ /// # #![allow(unused_assignments)]
40+ /// let x = 3; // We create a variable named `x` with the value `3`.
41+ /// ```
42+ ///
43+ /// By default, all variables are **not** mutable. If you want a mutable variable,
44+ /// you'll have to use the `mut` keyword.
45+ ///
46+ /// Example:
47+ ///
48+ /// ```rust
49+ /// # #![allow(unused_assignments)]
50+ /// let mut x = 3; // We create a mutable variable named `x` with the value `3`.
51+ ///
52+ /// x += 4; // `x` is now equal to `7`.
53+ /// ```
54+ ///
55+ /// For more information about the `let` keyword, take a look at the [Rust Book][book].
56+ ///
57+ /// [book]: https://doc.rust-lang.org/book/second-edition/ch03-01-variables-and-mutability.html
58+ mod let_keyword { }
You can’t perform that action at this time.
0 commit comments