Skip to content

Commit 5db0af7

Browse files
traviscrossehuss
andcommitted
Revise const context rules
Let's break this out into two rules and reword. Co-authored-by: Eric Huss <eric@huss.org>
1 parent e236619 commit 5db0af7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/const_eval.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ Certain forms of expressions, called constant expressions, can be evaluated at
1414
compile time.
1515

1616
r[const-eval.const-expr.const-context]
17-
In [const contexts](#const-context), these are the only allowed expressions, and they are always evaluated at compile time.
17+
Expressions in a [const context] must be constant expressions.
18+
19+
r[const-eval.const-expr.evaluation]
20+
Expressions in const contexts are always evaluated at compile time.
1821

1922
r[const-eval.const-expr.runtime-context]
2023
In other places, such as [let statements], constant expressions *may* be, but are not guaranteed to be, evaluated at compile time.

0 commit comments

Comments
 (0)