Skip to content

Commit c14d6ff

Browse files
apply suggestions
1 parent ad06623 commit c14d6ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/const_eval.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ r[const-eval.const-expr.path-item]
4343

4444
r[const-eval.const-expr.path-static]
4545
* Paths to [statics] with these restrictions and observations.
46-
* If the evaluation is carried out in an initializer of a `const` item, or inside a `const` block, reads and writes to any `static mut` or [`extern` statics] are not allowed.
47-
* If the evaluation is carried out in an initializer of a `static` item, reads into a `static`, or inside `unsafe` blocks reads into `static mut` are allowed. Reads and writes to `extern` statics are still not allowed.
46+
* Reads and writes to `extern` statics are not allowed in any constant evaluation context.
47+
* If the evaluation is carried out in an initializer of a `static` item, then *writes* into mutable `static` are not allowed, such as `static mut`s and `static`s containing an interior-mutable type.
48+
* If the evaluation is *not* carried out in an initializer of a `static` item, then reads and writes to any mutable `static`, such as `static mut`s and `static`s containing an interior-mutable type.
4849

4950
r[const-eval.const-expr.tuple]
5051
* [Tuple expressions].

0 commit comments

Comments
 (0)