On replacing UnsafeCell
Rust Internals [Unofficial]
April 1, 2026
Here are some pointers:
- repr(packed) allows invalid unaligned loads · Issue #27060 · rust-lang/rust · GitHub
- Tracking issue for
safe_packed_borrowscompatibility lint · Issue #46043 · rust-lang/rust · GitHub - Accessing DST field of packed struct calculates the wrong field address · Issue #80925 · rust-lang/rust · GitHub
- Misaligned reference from drop field in packed struct · Issue #99838 · rust-lang/rust · GitHub
- Undetected unsound usage of packed field by unsize coercion · Issue #115396 · rust-lang/rust · GitHub
- We are computing the wrong offset for unsized packed structs · Issue #118537 · rust-lang/rust · GitHub
As you can tell from the sheer number of soundness issues, this has not been a role model we want to copy.
Discussion in the ATmosphere