File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1028,8 +1028,6 @@ mod self_upper_keyword {}
10281028
10291029#[ doc( keyword = "static" ) ]
10301030//
1031- /// A place that is valid for the duration of a program.
1032- ///
10331031/// A static item is a value which is valid for the entire duration of your
10341032/// program (a `'static` lifetime).
10351033///
@@ -1045,7 +1043,7 @@ mod self_upper_keyword {}
10451043/// There are two types of `static` items: those declared in association with
10461044/// the [`mut`] keyword and those without.
10471045///
1048- /// Items that are both static and owned cannot be moved:
1046+ /// Static items cannot be moved:
10491047///
10501048/// ```rust,compile_fail,E0507
10511049/// static VEC: Vec<u32> = vec![];
@@ -1054,6 +1052,7 @@ mod self_upper_keyword {}
10541052/// v
10551053/// }
10561054///
1055+ /// // This line causes an error
10571056/// move_vec(VEC);
10581057/// ```
10591058///
@@ -1071,7 +1070,7 @@ mod self_upper_keyword {}
10711070/// let r2 = &FOO as *const _;
10721071/// // With a strictly read-only static, references will have the same adress
10731072/// assert_eq!(r1, r2);
1074- /// // A static item is used just like a variable
1073+ /// // A static item can be used just like a variable in many cases
10751074/// println!("{:?}", FOO);
10761075/// ```
10771076///
You can’t perform that action at this time.
0 commit comments