Skip to content

Commit 9faf042

Browse files
committed
provenance really is just ghost state
1 parent 80edfa8 commit 9faf042

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

reference/src/glossary.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Abstract Rust Machine is intended to operate according to the definition here.
5959

6060
The *provenance* of a pointer is used to distinguish pointers that point to the same memory address (i.e., pointers that, when cast to `usize`, will compare equal).
6161
Provenance is extra state that only exists in the Rust Abstract Machine; it is needed to specify program behavior but not present any more when the program runs on real hardware.
62+
In other words, pointers that only differ in their provenance can *not* be distinguished any more in the final binary (but provenance can influence how the compiler translates the program).
6263

6364
For example, we have to distinguish pointers to the same location if they originated from different allocations.
6465
Cross-allocation pointer arithmetic [does not lead to usable pointers](https://doc.rust-lang.org/std/primitive.pointer.html#method.wrapping_offset), so the Rust Abstract Machine *somehow* has to remember the original allocation to which a pointer pointed.

0 commit comments

Comments
 (0)