From 50c00a93016ee8987dc75d201fd8c9ed5e763441 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 29 Sep 2018 09:51:38 +0200 Subject: [PATCH] expand comment --- src/librustc_mir/interpret/memory.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index ab5e37a1d450..8b11a8ec4971 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -759,6 +759,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> { // SAFE: The above indexing would have panicked if there weren't at least `size` bytes // behind `src` and `dest`. Also, we use the overlapping-safe `ptr::copy` if `src` and // `dest` could possibly overlap. + // The pointers above remain valid even if the `HashMap` table moved around because they + // point into the `Vec` storing the bytes. unsafe { assert_eq!(size.bytes() as usize as u64, size.bytes()); if src.alloc_id == dest.alloc_id {