Fix small nits
This commit is contained in:
parent
dfd454bd38
commit
4224313e2b
1 changed files with 3 additions and 4 deletions
|
@ -1028,8 +1028,6 @@ mod self_upper_keyword {}
|
||||||
|
|
||||||
#[doc(keyword = "static")]
|
#[doc(keyword = "static")]
|
||||||
//
|
//
|
||||||
/// A place that is valid for the duration of a program.
|
|
||||||
///
|
|
||||||
/// A static item is a value which is valid for the entire duration of your
|
/// A static item is a value which is valid for the entire duration of your
|
||||||
/// program (a `'static` lifetime).
|
/// program (a `'static` lifetime).
|
||||||
///
|
///
|
||||||
|
@ -1045,7 +1043,7 @@ mod self_upper_keyword {}
|
||||||
/// There are two types of `static` items: those declared in association with
|
/// There are two types of `static` items: those declared in association with
|
||||||
/// the [`mut`] keyword and those without.
|
/// the [`mut`] keyword and those without.
|
||||||
///
|
///
|
||||||
/// Items that are both static and owned cannot be moved:
|
/// Static items cannot be moved:
|
||||||
///
|
///
|
||||||
/// ```rust,compile_fail,E0507
|
/// ```rust,compile_fail,E0507
|
||||||
/// static VEC: Vec<u32> = vec![];
|
/// static VEC: Vec<u32> = vec![];
|
||||||
|
@ -1054,6 +1052,7 @@ mod self_upper_keyword {}
|
||||||
/// v
|
/// v
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
|
/// // This line causes an error
|
||||||
/// move_vec(VEC);
|
/// move_vec(VEC);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
@ -1071,7 +1070,7 @@ mod self_upper_keyword {}
|
||||||
/// let r2 = &FOO as *const _;
|
/// let r2 = &FOO as *const _;
|
||||||
/// // With a strictly read-only static, references will have the same adress
|
/// // With a strictly read-only static, references will have the same adress
|
||||||
/// assert_eq!(r1, r2);
|
/// assert_eq!(r1, r2);
|
||||||
/// // A static item is used just like a variable
|
/// // A static item can be used just like a variable in many cases
|
||||||
/// println!("{:?}", FOO);
|
/// println!("{:?}", FOO);
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue