Skip to content

Commit f9121dc

Browse files
committed
Let bindings are now available in const contexts
1 parent 1c775a1 commit f9121dc

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
@@ -9,7 +9,7 @@ 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 *may*
12+
[let statement]s, constant expressions *may*
1313
be, but are not guaranteed to be, evaluated at compile time. Behaviors such as
1414
out of bounds [array indexing] or [overflow] are compiler errors if the value
1515
must be evaluated at compile time (i.e. in const contexts). Otherwise, these
@@ -40,6 +40,7 @@ to be ran.
4040
* [Cast] expressions, except pointer to address and
4141
function pointer to address casts.
4242
* Calls of const functions and const methods
43+
* [let statement]s and thus irrefutable [patterns]
4344

4445
## Const context
4546

@@ -81,3 +82,5 @@ A _const context_ is one of the following:
8182
[dereference operator]: expressions/operator-expr.html#the-dereference-operator
8283
[grouped]: expressions/grouped-expr.html
8384
[cast]: expressions/operator-expr.html#type-cast-expressions
85+
[let statement]: statements.html#let-statements
86+
[patterns]: patterns.html

0 commit comments

Comments
 (0)