]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_data_structures/src/memmap.rs
Rollup merge of #83669 - kwj2104:issue-81508-fix, r=varkor
[rust.git] / compiler / rustc_data_structures / src / memmap.rs
index 29e999efeb18d92d70c1b94ee9cc4a7050ed208b..26b26415eea0f85c0088385ed7da2096b0330a52 100644 (file)
@@ -40,4 +40,8 @@ fn deref(&self) -> &[u8] {
     }
 }
 
+// SAFETY: On architectures other than WASM, mmap is used as backing storage. The address of this
+// memory map is stable. On WASM, `Vec<u8>` is used as backing storage. The `Mmap` type doesn't
+// export any function that can cause the `Vec` to be re-allocated. As such the address of the
+// bytes inside this `Vec` is stable.
 unsafe impl StableAddress for Mmap {}