about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-12-25 10:45:48 +0100
committerRalf Jung <post@ralfj.de>2024-12-25 10:45:48 +0100
commit00dfa3ba2d21577649e882ee65309fdbee08bf6d (patch)
tree4d12ca75ff31f2ba6276b9bff66aecfe07785d94 /compiler
parent6de3a2e3a9c45e12f63a8e861131a39b1eb0e021 (diff)
downloadrust-00dfa3ba2d21577649e882ee65309fdbee08bf6d.tar.gz
rust-00dfa3ba2d21577649e882ee65309fdbee08bf6d.zip
miri: add test for overlapping typed_swap
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_const_eval/src/interpret/intrinsics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index e9eca8814c3..44f6335dc7f 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -649,7 +649,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         let kind = MemoryKind::Stack;
         let temp = self.allocate(left.layout, kind)?;
         self.copy_op(&left, &temp)?;
-        self.copy_op(&right, &left)?;
+        self.copy_op(&right, &left)?; // this checks that they are non-overlapping
         self.copy_op(&temp, &right)?;
         self.deallocate_ptr(temp.ptr(), None, kind)?;
         interp_ok(())