diff options
| author | Ralf Jung <post@ralfj.de> | 2024-12-21 08:32:47 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-12-21 08:34:55 +0100 |
| commit | 526d29865c3956ab0dcfba62df7a1933e1f1520d (patch) | |
| tree | 91f811e36422728d21e0df5897801afb28d4aae1 /compiler/rustc_const_eval/src/interpret/memory.rs | |
| parent | 13170cd787cb733ed24842ee825bcbd98dc01476 (diff) | |
| download | rust-526d29865c3956ab0dcfba62df7a1933e1f1520d.tar.gz rust-526d29865c3956ab0dcfba62df7a1933e1f1520d.zip | |
ptr::copy: fix docs for the overlapping case
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/memory.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 027ba9644cb..0790db984e3 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -1359,6 +1359,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { let src_alloc = self.get_alloc_raw(src_alloc_id)?; let src_range = alloc_range(src_offset, size); assert!(!self.memory.validation_in_progress, "we can't be copying during validation"); + // For the overlapping case, it is crucial that we trigger the read hook + // before the write hook -- the aliasing model cares about the order. M::before_memory_read( tcx, &self.machine, |
