Skip to content

v0.0.10

Latest
Compare
Choose a tag to compare
@BennoLossin BennoLossin released this 19 Aug 07:59
· 13 commits to main since this release

Added

  • Wrapper<T> trait added for creating wrapper structs with a structurally pinned value.
  • MaybeZeroable derive macro to try to derive Zeroable, but not error if not all fields
    implement it.
  • unsafe fn cast_[pin_]init() functions to unsafely change the initialized type of an initializer
  • impl<T, E> [Pin]Init<T, E> for Result<T, E>, so results are now (pin-)initializers
  • add Zeroable::init_zeroed() delegating to init_zeroed()
  • add new zeroed(), a safe version of mem::zeroed() and also provide it via Zeroable::zeroed()
  • implement Zeroable for Option<&T> and Option<&mut T>
  • implement Zeroable for Option<[unsafe] [extern "abi"] fn(...args...) -> ret> for "Rust" and
    "C" ABIs and up to 20 arguments

Changed

  • InPlaceInit now only exists when the alloc or std features are enabled
  • added support for visibility in Zeroable derive macro
  • added support for unions in Zeroable derive macro
  • renamed the crate from pinned-init to pin-init and pinned-init-macro to pin-init-internal
  • blanket impls of Init and PinInit from impl<T, E> [Pin]Init<T, E> for T to
    impl<T> [Pin]Init<T> for T
  • renamed zeroed() to init_zeroed()

Fixed

  • Zeroable implementation for Option<Box<T>> & Option<NonNull<T>> to only allow T: Sized
    (soundness issue)

    Full changes: v0.0.9...v0.0.10