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
Currently, we support T -> U conversions using the transmute! macro when T: AsBytes, U: FromBytes, and T and U have the same size. In principle, we ought to be able to support a range of conversions for container types wrapping T and U so long as those containers have well-defined layouts. Specifically:
Slices
Box (the docs guarantee Box's layout for Sized types)
ManuallyDrop (the docs guarantee that ManuallyDrop<T>'s layout is equivalent to T's)
Wrapping (the docs guarantee that Wrapping<T>'s layout is equivalent to T's)
For two possible approaches, see #1183 and #1735.
Currently, we support
T -> U
conversions using the transmute! macro whenT: AsBytes
,U: FromBytes
, andT
andU
have the same size. In principle, we ought to be able to support a range of conversions for container types wrappingT
andU
so long as those containers have well-defined layouts. Specifically:Box
(the docs guaranteeBox
's layout forSized
types)ManuallyDrop
(the docs guarantee thatManuallyDrop<T>
's layout is equivalent toT
's)Wrapping
(the docs guarantee thatWrapping<T>
's layout is equivalent toT
's)...and possibly others.
This will help unblock ICU4X using zerocopy.
The text was updated successfully, but these errors were encountered: