5 releases

0.1.1 Dec 10, 2023
0.1.1-rc1 Dec 6, 2023
0.1.0 Jul 20, 2023
0.0.0 Jun 20, 2023

#182 in Memory management

Zlib OR MIT OR Apache-2.0

28KB
281 lines

::maybe-dangling

ManuallyDrop<T> and MaybeDangling<T> semantics in stable Rust as per https://github.com/rust-lang/rfcs/pull/3336

Repository Latest version Documentation MSRV License CI no_std compatible

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:

  1. have some expired value inside of them, such as T = &'expired,
  2. be fed to a function that does not inspect its value (such as ::core::mem::forget()),
  3. exhibit well-defined behavior (no UB!).

References

No runtime deps

Features