Apparently the latest release of `bytemuck` doesn't compile on some of
the targets that it used to because it uses `Arc`. `Arc` is not a type
that exists on every target, because not every targets supports atomics.
It seems like a copy-paste error has happened between `try_from_bytes`/`try_from_bytes_mut` and `try_pod_read_unaligned`, causing `internal::try_pod_read_unaligned` to try to read a &T::Bits instead of a T::Bits, usually failing with a `SizeMismatch` error. In the worst case, this allows UB in safe code by having a type allowing any bit pattern and being pointer-sized.
* Add `allocation::{try_,}cast_{arc,rc}`, and add `{wrap,peel}_{arc,rc}` to `TransparentWrapperAlloc`.
* Avoid intermediate slice reference in `try_cast_slice_{arc,rc}`.
* remove `unsafe` block; run `cargo +nightly fmt` (ignoring files I didn't modify)
* Make `cast_rc` (etc) have the same bounds as `cast_mut`, due to the existence of `Rc::get_mut_unchecked`.
* add `try_zeroed_vec` and `zeroed_vec`, adjust impl of `try_zeroed_slice_box`
* go back to returning an error rather than calling handle_alloc_error
* use boxed slice .into_vec instead :)
* same as Zeroable and Pod but for types which are Zeroable and Pod when
wrapped in Option
* allows downstream users to implement Zeroable and Pod for their own
Option<T> types without running into orphan rules
Normal Miri does not provide sufficient safety guarantees. Using the flag `-Zmiri-tag-raw-pointers` also checks usage of pointers in a more strict way.
* Added try_cast_slice_box and cast_slice_box
* Modified try_cast_slice_box and try_cast_vec to recalculate the length if the change in size between the two types is valid.
* Ran cargo format
* allow deriving traits on unions in some cases
* basic union tests for nopadding and anybitpattern
* implement derives for unions for more traits
* remove Pod and AnyBitPattern derives for unions due to possible unsoundness