Skip to content

Commit bc95b74

Browse files
committed
Fix language around constant expression guarantees.
1 parent a7be9dd commit bc95b74

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/const_eval.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ can be evaluated at compile-time.
99
Certain forms of expressions, called constant expressions, can be evaluated at
1010
compile time. In [const contexts](#const-context), these are the only allowed
1111
expressions, and are always evaluated at compile time. In other places, such as
12-
[`let` statements](statements.html#let-statements), constant expressions are
13-
Behaviors such as out of bounds [array indexing] or [overflow] are compiler errors
14-
if the value must be evaluated at compile time (i.e. in const contexts).
15-
Otherwise, these behaviors are warnings, but will likely panic at run-time.
12+
[`let` statements](statements.html#let-statements), constant expressions *may*
13+
be, but are not guaranteed to be, evaluated at compile time. Behaviors such as
14+
out of bounds [array indexing] or [overflow] are compiler errors if the value
15+
must be evaluated at compile time (i.e. in const contexts). Otherwise, these
16+
behaviors are warnings, but will likely panic at run-time.
1617

1718
The following expressions are constant expressions, so long as any operands are
1819
also constant expressions and do not cause any [`Drop::drop`][destructors] calls

0 commit comments

Comments
 (0)