You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With container transmutation + safe transmute, we could support [Bucket<T>] -> Slice<T> transmutation, e.g. used in this code:
#[repr(transparent)]pubstructSlice<T>{pub(crate)entries:[Bucket<T>],}// SAFETY: `Slice<T>` is a transparent wrapper around `[Bucket<T>]`,// and reference lifetimes are bound together in function signatures.#[allow(unsafe_code)]impl<T>Slice<T>{pub(super)constfnfrom_slice(entries:&[Bucket<T>]) -> &Self{unsafe{&*(entries as*const[Bucket<T>]as*constSelf)}}pub(super)fnfrom_boxed(entries:Box<[Bucket<T>]>) -> Box<Self>{unsafe{Box::from_raw(Box::into_raw(entries)as*mutSelf)}}fninto_boxed(self:Box<Self>) -> Box<[Bucket<T>]>{unsafe{Box::from_raw(Box::into_raw(self)as*mut[Bucket<T>])}}}
The text was updated successfully, but these errors were encountered:
Container transmutation (#114) + safe transmute
With container transmutation + safe transmute, we could support
[Bucket<T>] -> Slice<T>
transmutation, e.g. used in this code:The text was updated successfully, but these errors were encountered: