ManuallyDrop<T>
and MaybeDangling<T>
semantics in stable Rust as per rust-lang/rfcs#3336
This crates offers two types, ManuallyDrop<T>
, and MaybeDangling<T>
, which do not carry
aliasing/dereferenceable
-ity properties w.r.t. the
T
they each contain, which means they are allowed to:
- have some expired value inside of them, such as
T = &'expired …
, - be fed to a function that does not inspect its value (such as
::core::mem::forget()
), - exhibit well-defined behavior (no UB!).
-
The RFC that shall eventually and ultimately supersede this very crate: rust-lang/rfcs#3336
-
The
miri
PR implementing the check against this: rust-lang/miri#2985 -
The soundness problem of
::ouroboros
stemming from not using this: someguynamedjosh/ouroboros#88 -
The soundness problem of
::yoke
stemming from not using this: unicode-org/icu4x#3696 -
An URLO thread on the topic, and my post exposing the intention to write this very crate