@@ -1356,6 +1356,9 @@ A *static item* is a named _constant value_ stored in the global data section of
1356
1356
Immutable static items are stored in the read-only data section.
1357
1357
The constant value bound to a static item is, like all constant values, evaluated at compile time.
1358
1358
Static items have the ` static ` lifetime, which outlives all other lifetimes in a Rust program.
1359
+ Only values stored in the global data section (such as string constants
1360
+ and static items) can have the ` static ` lifetime;
1361
+ dynamically constructed values cannot safely be assigned the ` static ` lifetime.
1359
1362
Static items are declared with the ` static ` keyword.
1360
1363
A static item must have a _ constant expression_ giving its definition.
1361
1364
@@ -3621,7 +3624,10 @@ There are four varieties of pointer in Rust:
3621
3624
References arise by (automatic) conversion from owning pointers, managed pointers,
3622
3625
or by applying the borrowing operator ` & ` to some other value,
3623
3626
including [ lvalues, rvalues or temporaries] ( #lvalues,-rvalues-and-temporaries ) .
3624
- References are written ` &content ` , or in some cases ` &'f content ` for some lifetime-variable ` f ` ,
3627
+ A borrow expression is written ` &content ` .
3628
+
3629
+ A reference type is written ` &'f type ` for some lifetime-variable ` f ` ,
3630
+ or just ` &type ` when the lifetime can be elided;
3625
3631
for example ` &int ` means a reference to an integer.
3626
3632
Copying a reference is a "shallow" operation:
3627
3633
it involves only copying the pointer itself.
0 commit comments