@@ -6,13 +6,13 @@ can be evaluated at compile-time.
6
6
7
7
## Constant expressions
8
8
9
- Certain types of expressions can be evaluated at compile time. These are called
10
- _ constant expressions _ and are required in const contexts. In
11
- other places, such as in [ ` let ` statements ] ( statements.html#let-statements ) ,
12
- constant expressions may be evaluated at compile time. If errors, such as out
13
- of bounds [ array indexing] or [ overflow] occurs,
14
- then it is a compiler error if the value must be evaluated at compile time,
15
- otherwise it is just a warning , but the code will most likely panic when run.
9
+ Certain types of expressions, called constant expressions, can be evaluated at
10
+ compile time. In [ const contexts ] ( #const-context ) , these are the only allowed
11
+ expressions, and are always evaluated at compile time. In other places, such as
12
+ in [ ` let ` statements ] ( statements.html#let-statements ) , constant expressions are
13
+ Errors 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 they are just warnings , but the code will most likely panic when run.
16
16
17
17
The following expressions are constant expressions, so long as any operands are
18
18
also constant expressions and do not cause any [ ` Drop::drop ` ] [ destructors ] calls
0 commit comments