Skip to content

Commit 61db5dc

Browse files
committed
expand on my referring to existing mutable statics is fine
1 parent 7153ee9 commit 61db5dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

const.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ note the FIXME added [by this PR](https://github.com/rust-lang/rust/pull/63955):
6262
for untyped data in a constant, we currently just *make* it immutable, instead
6363
of checking properly.
6464

65+
Note that a constant *referring to* some already existing mutable memory is
66+
fine: inlining that reference everywhere has the same behavior as computing a
67+
new reference each time. In both cases, there exists exactly one instance of
68+
the mutable memory that everything references.
69+
6570
### 3. `Sync`
6671

6772
Finally, the same constant reference is actually shared across threads. This is

0 commit comments

Comments
 (0)