Skip to content

Commit 8297755

Browse files
Update posts/2025-01-09-Rust-1.84.0.md
Co-authored-by: Travis Cross <tc@traviscross.com>
1 parent a65cd81 commit 8297755

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

posts/2025-01-09-Rust-1.84.0.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,16 @@ and the [stabilization report](https://github.com/rust-lang/rust/pull/130654)
7676

7777
### Strict provenance APIs
7878

79-
In Rust, [pointers are not simply an “integer” or
80-
“address”](https://rust-lang.github.io/rfcs/3559-rust-has-provenance.html). For
81-
instance, it’s uncontroversial to say that a Use After Free is clearly
82-
Undefined Behavior, even if you “get lucky” and the freed memory gets
83-
reallocated before your read/write. It is also uncontroversial that writing
84-
through a pointer derived from an `&i32` reference is Undefined Behavior, even
79+
In Rust, [pointers are not simply an "integer" or
80+
"address"](https://rust-lang.github.io/rfcs/3559-rust-has-provenance.html). For
81+
instance, a "use after free" is undefined behavior even if you "get lucky" and the freed memory gets
82+
reallocated before your read/write. As another example, writing
83+
through a pointer derived from an `&i32` reference is undefined behavior, even
8584
if writing to the same address via a different pointer is legal. The underlying
8685
pattern here is that *the way a pointer is computed matters*, not just the
8786
address that results from this computation. For this reason, we say that
88-
pointers have **provenance**: to fully characterize pointer-related Undefined
89-
Behavior in Rust, we have to know not only the address the pointer points to,
87+
pointers have **provenance**: to fully characterize pointer-related undefined
88+
behavior in Rust, we have to know not only the address the pointer points to,
9089
but also track which other pointer(s) it is "derived from".
9190

9291
Most of the time, programmers do not need to worry much about provenance, and

0 commit comments

Comments
 (0)