Skip to content

Commit 74a8cc6

Browse files
authored
Merge pull request #2817 from gurry/patch-1
Change `ConstValue::ByRef` to `ConstValue::Indirect`
2 parents dfa57c3 + 2270030 commit 74a8cc6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/const-eval/interpret.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ what is needed *during* const evaluation, while [`ConstValue`] is shaped by the
8989
needs of the remaining parts of the compiler that consume the results of const
9090
evaluation. As part of this conversion, for types with scalar values, even if
9191
the resulting [`Operand`] is `Indirect`, it will return an immediate
92-
`ConstValue::Scalar(computed_value)` (instead of the usual `ConstValue::ByRef`).
92+
`ConstValue::Scalar(computed_value)` (instead of the usual `ConstValue::Indirect`).
9393
This makes using the result much more efficient and also more convenient, as no
9494
further queries need to be executed in order to get at something as simple as a
9595
`usize`.
@@ -110,7 +110,7 @@ The interpreter's outside-facing datastructures can be found in
110110
This is mainly the error enum and the [`ConstValue`] and [`Scalar`] types. A
111111
`ConstValue` can be either `Scalar` (a single `Scalar`, i.e., integer or thin
112112
pointer), `Slice` (to represent byte slices and strings, as needed for pattern
113-
matching) or `ByRef`, which is used for anything else and refers to a virtual
113+
matching) or `Indirect`, which is used for anything else and refers to a virtual
114114
allocation. These allocations can be accessed via the methods on
115115
`tcx.interpret_interner`. A `Scalar` is either some `Raw` integer or a pointer;
116116
see [the next section](#memory) for more on that.
@@ -207,7 +207,7 @@ values.
207207
Although the main entry point to constant evaluation is the `tcx.const_eval_*`
208208
functions, there are additional functions in
209209
[rustc_const_eval/src/const_eval](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_const_eval/index.html)
210-
that allow accessing the fields of a `ConstValue` (`ByRef` or otherwise). You should
210+
that allow accessing the fields of a `ConstValue` (`Indirect` or otherwise). You should
211211
never have to access an `Allocation` directly except for translating it to the
212212
compilation target (at the moment just LLVM).
213213

0 commit comments

Comments
 (0)