3 ms·
The current behavior is clearly documented in the Rust Reference[1]: >The following language level features cannot be used in the safe subset of Rust: > Derefe
by EE84M3i 2y ago
The current behavior is clearly documented in the Rust Reference[1]:
>The following language level features cannot be used in the safe subset of Rust:
> Dereferencing a raw pointer.
> Reading or writing a mutable or external static variable.
> Accessing a field of a union, other than to assign to it.
> Calling an unsafe function (including an intrinsic or foreign function).
> Implementing an unsafe trait.
It also calls out the behavior in noted in this specific post in "Behavior not considered unsafe"[2]:
> Exposing randomized base addresses through pointer leaks
[1]: https://doc.rust-lang.org/reference/unsafety.html https://doc.rust-lang.org/reference/unsafety.html
[2]: https://doc.rust-lang.org/reference/behavior-not-considered-unsafe.html https://doc.rust-lang.org/reference/behavior-not-considered-...