about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-14 08:51:19 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-02-14 08:51:19 +0000
commit936bf29d4cec40c328930daf83277d7e77cc9602 (patch)
treea10030d4bdb00472c76d910191816f7f9e6f334b /compiler/rustc_const_eval/src/interpret
parentc3c6d73b04a718aceabc314bf231a20c90ccd601 (diff)
downloadrust-936bf29d4cec40c328930daf83277d7e77cc9602.tar.gz
rust-936bf29d4cec40c328930daf83277d7e77cc9602.zip
s/eval_usize/eval_target_usize/ for clarity
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-rw-r--r--compiler/rustc_const_eval/src/interpret/cast.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs
index fc8e0c67ae0..9d00e338d45 100644
--- a/compiler/rustc_const_eval/src/interpret/cast.rs
+++ b/compiler/rustc_const_eval/src/interpret/cast.rs
@@ -328,8 +328,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             (&ty::Array(_, length), &ty::Slice(_)) => {
                 let ptr = self.read_scalar(src)?;
                 // u64 cast is from usize to u64, which is always good
-                let val =
-                    Immediate::new_slice(ptr, length.eval_usize(*self.tcx, self.param_env), self);
+                let val = Immediate::new_slice(
+                    ptr,
+                    length.eval_target_usize(*self.tcx, self.param_env),
+                    self,
+                );
                 self.write_immediate(val, dest)
             }
             (ty::Dynamic(data_a, ..), ty::Dynamic(data_b, ..)) => {