diff options
| author | Gary Guo <gary@garyguo.net> | 2021-09-06 18:33:23 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2021-09-25 01:08:41 +0100 |
| commit | c38da2e0a322908ba4b1d4b7e59c5da0531af4e1 (patch) | |
| tree | cd26f185c4302d0389f8703ea0d2b76cfa1ac4ba /compiler/rustc_const_eval/src/interpret | |
| parent | 308dffd25cb55bbb4a1fbee9822cf82c6a5d012d (diff) | |
| download | rust-c38da2e0a322908ba4b1d4b7e59c5da0531af4e1.tar.gz rust-c38da2e0a322908ba4b1d4b7e59c5da0531af4e1.zip | |
Introduce `Rvalue::ShallowInitBox`
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/step.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs index 6e35b33188c..bcce19b28db 100644 --- a/compiler/rustc_const_eval/src/interpret/step.rs +++ b/compiler/rustc_const_eval/src/interpret/step.rs @@ -289,6 +289,12 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { self.write_scalar(Scalar::from_machine_usize(val, self), &dest)?; } + ShallowInitBox(ref operand, _) => { + let src = self.eval_operand(operand, None)?; + let v = self.read_immediate(&src)?; + self.write_immediate(*v, &dest)?; + } + Cast(cast_kind, ref operand, cast_ty) => { let src = self.eval_operand(operand, None)?; let cast_ty = self.subst_from_current_frame_and_normalize_erasing_regions(cast_ty); |
