Skip to content

Commit 852baf5

Browse files
committed
Apply reviews from RalfJung
1 parent d817953 commit 852baf5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/const-eval.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ Additionally constant evaluation can be used to reduce the workload or binary
2020
size at runtime by precomputing complex operations at compiletime and only
2121
storing the result.
2222

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.
2425

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
2627
in which the constant is evaluated (e.g. the function within which the constant is used)
2728
and a [`GlobalId`]. The `GlobalId` is made up of an `Instance` referring to a constant
2829
or static or of an `Instance` of a function and an index into the function's `Promoted` table.
2930

3031
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
3233
integer or fat pointer, it will directly yield the value (via [`ConstValue::Scalar`]
3334
or [`ConstValue::Slice`]), instead of referring to the [`miri`](./miri.html) virtual
3435
memory allocation (via [`ConstValue::ByRef`]). This means that the `const_eval_*`

0 commit comments

Comments
 (0)