Skip to content

danielhenrymantilla/maybe-dangling.rs

::maybe-dangling

ManuallyDrop<T> and MaybeDangling<T> semantics in stable Rust as per rust-lang/rfcs#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

About

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

Resources

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Zlib
LICENSE-ZLIB

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •