Skip to content

Commit d4b21f1

Browse files
committed
expand safety comment in memory.rs
1 parent 397283d commit d4b21f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/memory.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
586586
/// The last argument controls whether we error out when there are undefined
587587
/// or pointer bytes. You should never call this, call `get_bytes` or
588588
/// `get_bytes_with_undef_and_ptr` instead,
589+
///
590+
/// This function also guarantees that the resulting pointer will remain stable
591+
/// even when new allocations are pushed to the `HashMap`. `copy_repeatedly` relies
592+
/// on that.
589593
fn get_bytes_internal(
590594
&self,
591595
ptr: Pointer<M::PointerTag>,

0 commit comments

Comments
 (0)