about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/step.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-31 18:42:49 +0000
committerbors <bors@rust-lang.org>2022-08-31 18:42:49 +0000
commit9243168fa5615ec8ebe9164c6bc2fdcccffd08b6 (patch)
tree524048518ab07c1d30afae12d2295b4b3b2a3cb4 /compiler/rustc_const_eval/src/interpret/step.rs
parent4fd4de7ea358ad6fc28c5780533ea8ccc09e1006 (diff)
parent7913edb5c736b7c7d0918d32133999dfd6692604 (diff)
Auto merge of #100085 - RalfJung:op-ty-len, r=oli-obk
interpret: use new OpTy::len for Len rvalue

This avoids a `force_allocation`.
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/step.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 683e11ff7e0..6b827149f50 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -251,8 +251,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
 
             Len(place) => {
                 let src = self.eval_place(place)?;
-                let mplace = self.force_allocation(&src)?;
-                let len = mplace.len(self)?;
+                let op = self.place_to_op(&src)?;
+                let len = op.len(self)?;
                 self.write_scalar(Scalar::from_machine_usize(len, self), &dest)?;
             }