diff options
| author | Ralf Jung <post@ralfj.de> | 2018-09-29 09:51:38 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-10-10 09:51:16 +0200 |
| commit | 50c00a93016ee8987dc75d201fd8c9ed5e763441 (patch) | |
| tree | 551fdcae5e13b9377fc31f8f1826581664de2a8f | |
| parent | f3a39e38f6109b2e0080a45ae47406796c2eac59 (diff) | |
| download | rust-50c00a93016ee8987dc75d201fd8c9ed5e763441.tar.gz rust-50c00a93016ee8987dc75d201fd8c9ed5e763441.zip | |
expand comment
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index ab5e37a1d45..8b11a8ec497 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 { |
