Skip to content

Commit 50c00a9

Browse files
committed
expand comment
1 parent f3a39e3 commit 50c00a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_mir/interpret/memory.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
759759
// SAFE: The above indexing would have panicked if there weren't at least `size` bytes
760760
// behind `src` and `dest`. Also, we use the overlapping-safe `ptr::copy` if `src` and
761761
// `dest` could possibly overlap.
762+
// The pointers above remain valid even if the `HashMap` table moved around because they
763+
// point into the `Vec` storing the bytes.
762764
unsafe {
763765
assert_eq!(size.bytes() as usize as u64, size.bytes());
764766
if src.alloc_id == dest.alloc_id {

0 commit comments

Comments
 (0)