File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -20,15 +20,16 @@ Additionally constant evaluation can be used to reduce the workload or binary
20
20
size at runtime by precomputing complex operations at compiletime and only
21
21
storing the result.
22
22
23
- Constant evaluation can be done by calling the ` const_eval_* ` queries of ` TyCtxt ` .
23
+ Constant evaluation can be done by calling the ` const_eval_* ` functions of ` TyCtxt ` .
24
+ They're the wrappers of the ` const_eval ` query.
24
25
25
- The ` const_eval_* ` queries use a [ ` ParamEnv ` ] ( ./param_env.html ) of environment
26
+ The ` const_eval_* ` functions use a [ ` ParamEnv ` ] ( ./param_env.html ) of environment
26
27
in which the constant is evaluated (e.g. the function within which the constant is used)
27
28
and a [ ` GlobalId ` ] . The ` GlobalId ` is made up of an ` Instance ` referring to a constant
28
29
or static or of an ` Instance ` of a function and an index into the function's ` Promoted ` table.
29
30
30
31
Constant evaluation returns a [ ` ConstEvalResult ` ] with either the error, or the simplest
31
- representation of the constant. "simplest" meaning if it is representable as an
32
+ representation of the constant. "simplest" meaning if the ` const ` item is representable as an
32
33
integer or fat pointer, it will directly yield the value (via [ ` ConstValue::Scalar ` ]
33
34
or [ ` ConstValue::Slice ` ] ), instead of referring to the [ ` miri ` ] ( ./miri.html ) virtual
34
35
memory allocation (via [ ` ConstValue::ByRef ` ] ). This means that the ` const_eval_* `
You can’t perform that action at this time.
0 commit comments