File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,16 @@ r[const-eval.const-expr.path-item]
42
42
Recursively defining constants is not allowed.
43
43
44
44
r[ const-eval.const-expr.path-static]
45
- * Paths to [ statics] with these restrictions and observations .
45
+ * Paths to [ statics] with these restrictions.
46
46
* Writes to ` static ` items are not allowed in any constant evaluation context.
47
47
* Reads from ` extern ` statics are not allowed in any constant evaluation context.
48
48
* If the evaluation is * not* carried out in an initializer of a ` static ` item,
49
49
then reads from any mutable ` static ` are not allowed.
50
50
A mutable ` static ` is a ` static mut ` item, or a ` static ` item with an interior-mutable type.
51
51
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
+
52
55
r[ const-eval.const-expr.tuple]
53
56
* [ Tuple expressions] .
54
57
You can’t perform that action at this time.
0 commit comments