Skip to content

Commit 69a7232

Browse files
focus on the cases rejected by const eval
1 parent c14d6ff commit 69a7232

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/const_eval.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ 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-
* 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.
46+
* Writes to `static` items are not allowed in any constant evaluation context.
47+
* Reads from `extern` statics are not allowed in any constant evaluation context.
48+
* If the evaluation is *not* carried out in an initializer of a `static` item,
49+
then reads from any mutable `static` are not allowed.
50+
By mutable `static` it includes `static mut`s and `static`s containing an interior-mutable type.
4951

5052
r[const-eval.const-expr.tuple]
5153
* [Tuple expressions].

0 commit comments

Comments
 (0)