@@ -11,21 +11,27 @@ r[items.static.syntax]
1111> allowed semantically within ` extern ` blocks.
1212
1313r[ items.static.intro]
14- A * static item* is similar to a [ constant] , except that it represents a precise
15- memory location in the program . All references to the static refer to the same
16- memory location .
14+ A * static item* is similar to a [ constant] , except that it represents an allocated object in the
15+ program that is initialized with the initializer expression . All references and raw pointers to the
16+ static refer to the same allocated object .
1717
1818r[ items.static.lifetime]
19- Static items have the ` static ` lifetime, which outlives all
20- other lifetimes in a Rust program. Static items do not call [ ` drop ` ] at the
21- end of the program.
19+ Static items have the ` static ` lifetime, which outlives all other lifetimes in a Rust program.
20+ Static items do not call [ ` drop ` ] at the end of the program.
21+
22+ r[ items.static.storage-disjointness]
23+ If the ` static ` has a size of at least 1 byte, this allocated object is disjoint from all other such
24+ ` static ` objects as well as heap allocations and stack-allocated variables. However, the storage of
25+ immutable ` static ` items can overlap with objects that do not themselves have a unique address, such
26+ as [ promoteds] and [ ` const ` items] [ constant ] .
2227
2328r[ items.static.namespace]
2429The static declaration defines a static value in the [ value namespace] of the module or block where it is located.
2530
2631r[ items.static.init]
2732The static initializer is a [ constant expression] evaluated at compile time.
28- 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.
2935
3036r[ items.static.read-only]
3137Non-` mut ` static items that contain a type that is not [ interior mutable] may
@@ -166,3 +172,4 @@ following are true:
166172[ _Expression_ ] : ../expressions.md
167173[ value namespace ] : ../names/namespaces.md
168174[ _ItemSafety_ ] : functions.md
175+ [ promoteds ] : ../destructors.md#constant-promotion
0 commit comments