From 00dfa3ba2d21577649e882ee65309fdbee08bf6d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 25 Dec 2024 10:45:48 +0100 Subject: miri: add test for overlapping typed_swap --- compiler/rustc_const_eval/src/interpret/intrinsics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval/src') 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(()) -- cgit 1.4.1-3-g733a5