@@ -12,21 +12,26 @@ r[items.static.syntax]
1212> allowed semantically within ` extern ` blocks.
1313
1414r[ items.static.intro]
15- A * static item* is similar to a [ constant] , except that it represents a precise
16- memory location in the program . All references to the static refer to the same
17- memory location .
15+ A * static item* is similar to a [ constant] , except that it represents an allocated object in the
16+ program that is initialized with the initializer expression . All references and raw pointers to the
17+ static refer to the same allocated object .
1818
1919r[ items.static.lifetime]
20- Static items have the ` static ` lifetime, which outlives all
21- other lifetimes in a Rust program. Static items do not call [ ` drop ` ] at the
22- end of the program.
20+ Static items have the ` static ` lifetime, which outlives all other lifetimes in a Rust program.
21+ Static items do not call [ ` drop ` ] at the end of the program.
22+
23+ r[ items.static.storage-disjointness]
24+ This allocated object is disjoint from all other ` static ` objects as well as heap-allocated and
25+ stack-allocated variables. However, the storage of immutable ` static ` items can overlap with objects
26+ that do not themselves have a unique address, such as [ promoteds] and [ ` const ` items] [ constant ] .
2327
2428r[ items.static.namespace]
2529The static declaration defines a static value in the [ value namespace] of the module or block where it is located.
2630
2731r[ items.static.init]
2832The static initializer is a [ constant expression] evaluated at compile time.
29- Static initializers may refer to other statics.
33+ Static initializers may refer to and read from other statics.
34+ When reading from mutable statics, they read the initial value of that static.
3035
3136r[ items.static.read-only]
3237Non-` mut ` static items that contain a type that is not [ interior mutable] may
@@ -173,3 +178,4 @@ following are true:
173178[ _Expression_ ] : ../expressions.md
174179[ value namespace ] : ../names/namespaces.md
175180[ _ItemSafety_ ] : functions.md
181+ [ promoteds ] : ../destructors.md#constant-promotion
0 commit comments