File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -162,9 +162,8 @@ attributes].
162
162
163
163
## Const functions
164
164
165
- Functions can be ` const ` , meaning they can be called from within array length
166
- expressions and the initializer of constants, statics and enum discriminants.
167
- When called from such a so-called "const context", the function is interpreted
165
+ Functions can be ` const ` , meaning they can be called from within
166
+ [ const contexts] . When called from a const context, the function is interpreted
168
167
by the compiler at compile time. The interpretation happens in the environment
169
168
of the compilation target and not the host. So ` usize ` is ` 32 ` bits if you are
170
169
compiling against a ` 32 ` bit system, irrelevant of whether you are building on
@@ -224,6 +223,7 @@ Exhaustive list of permitted structures in `const fn`:
224
223
[ _Statement_ ] : statements.html
225
224
[ _Type_ ] : types.html
226
225
[ _WhereClause_ ] : items/generics.html#where-clauses
226
+ [ const contexts ] : const_eval.html
227
227
[ external blocks ] : items/external-blocks.html
228
228
[ path ] : paths.html
229
229
[ block ] : expressions/block-expr.html
You can’t perform that action at this time.
0 commit comments