Skip to content

Commit b086fc0

Browse files
apply suggestions
1 parent 911b16f commit b086fc0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/const_eval.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@ r[const-eval.const-expr.path-item]
4242
Recursively defining constants is not allowed.
4343

4444
r[const-eval.const-expr.path-static]
45-
* Paths to [statics] with these restrictions and observations.
45+
* Paths to [statics] with these restrictions.
4646
* Writes to `static` items are not allowed in any constant evaluation context.
4747
* Reads from `extern` statics are not allowed in any constant evaluation context.
4848
* If the evaluation is *not* carried out in an initializer of a `static` item,
4949
then reads from any mutable `static` are not allowed.
5050
A mutable `static` is a `static mut` item, or a `static` item with an interior-mutable type.
5151

52+
These requirements are checked only when the constant is evaluated.
53+
In other words, having such accessed syntactically occur in const contexts is allowed as long as they never get executed.
54+
5255
r[const-eval.const-expr.tuple]
5356
* [Tuple expressions].
5457

0 commit comments

Comments
 (0)