You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the const eval chapter, we have a list of kinds of expressions that
are allowed. Paths to statics are one kind that is allowed, but have
certain restrictions we describe in bullet points. We then have text
that clarifies when these bullet points are checked.
This text was outdented beyond the relevant item, which broke up the
outer bullet point list and created (momentary) ambiguity about the
scope of the rules the language might be affecting. Let's fix that.
* Reads from `extern` statics are not allowed in any constant evaluation context.
47
47
* If the evaluation is *not* carried out in an initializer of a `static` item, then reads from any mutable `static` are not allowed. A mutable `static` is a `static mut` item, or a `static` item with an interior-mutable type.
48
48
49
-
These requirements are checked only when the constant is evaluated. In other words, having such accesses syntactically occur in const contexts is allowed as long as they never get executed.
49
+
These requirements are checked only when the constant is evaluated. In other words, having such accesses syntactically occur in const contexts is allowed as long as they never get executed.
0 commit comments