File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,12 @@ Constant evaluation returns a [`ConstEvalResult`] with either the error, or the
31
31
representation of the constant. "simplest" meaning if it is representable as an
32
32
integer or fat pointer, it will directly yield the value (via [ ` ConstValue::Scalar ` ]
33
33
or [ ` ConstValue::Slice ` ] ), instead of referring to the [ ` miri ` ] ( ./miri.html ) virtual
34
- memory allocation (via [ ` ConstValue::ByRef ` ] ). This means that the ` const_eval_* `
35
- functions cannot be used to create miri-pointers to the evaluated constant or
36
- static. If you need that, you need to directly work with the functions in
37
- [ ` src/librustc_mir/const_eval.rs ` ] .
34
+ memory allocation (via [ ` ConstValue::ByRef ` ] ). If you need the value of a constant inside Miri,
35
+ you need to directly work with [ ` eval_const_to_op ` ] .
38
36
39
37
[ `GlobalId` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/struct.GlobalId.html
40
38
[ `ConstValue::Scalar` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/value/enum.ConstValue.html#variant.Scalar
41
39
[ `ConstValue::Slice` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/value/enum.ConstValue.html#variant.Slice
42
40
[ `ConstValue::ByRef` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/value/enum.ConstValue.html#variant.ByRef
43
41
[ `ConstEvalResult` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/interpret/error/type.ConstEvalResult.html
44
- [ `src/librustc_mir/const_eval.rs ` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/const_eval/index. html
42
+ [ `eval_const_to_op ` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/interpret/struct.InterpCx. html#method.eval_const_to_op
You can’t perform that action at this time.
0 commit comments