about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/step.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-08-01 10:19:13 +0200
committerRalf Jung <post@ralfj.de>2024-08-01 14:25:19 +0200
commit5d5c97aad7cd2803b6dbecdd34293616065dc6b2 (patch)
tree93bebd9a74e94a2378386afc8a08273b130df436 /compiler/rustc_const_eval/src/interpret/step.rs
parentde78cb56b2fa62b7a5cbb036d05e638dd474c6c3 (diff)
downloadrust-5d5c97aad7cd2803b6dbecdd34293616065dc6b2.tar.gz
rust-5d5c97aad7cd2803b6dbecdd34293616065dc6b2.zip
interpret: simplify pointer arithmetic logic
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/step.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 48433d95c51..211a7b23002 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -362,7 +362,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
             // of the first element.
             let elem_size = first.layout.size;
             let first_ptr = first.ptr();
-            let rest_ptr = first_ptr.offset(elem_size, self)?;
+            let rest_ptr = first_ptr.wrapping_offset(elem_size, self);
             // No alignment requirement since `copy_op` above already checked it.
             self.mem_copy_repeatedly(
                 first_ptr,