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
Should we impl TryFromBytes for Unalign<T> where T: TryFromBytes? There are a few cases, and many of them are thorny:
For T: Unaligned, we could already support this by delegating to T::is_bit_valid.
For T: !Unaligned (ie, T in the general case without an Unaligned bound), we can't delegate to T::is_bit_valid because it requires an aligned MaybeValid<T>. We could copy the Unalign<T> into the local stack frame in order to ensure its alignment and then call T::is_bit_valid on the local copy, but that could be very expensive.
If we add support for unsized T, then for T: !Unaligned, copying into the local stack frame isn't even an option.
Should we impl
TryFromBytes
forUnalign<T>
whereT: TryFromBytes
? There are a few cases, and many of them are thorny:T: Unaligned
, we could already support this by delegating toT::is_bit_valid
.T: !Unaligned
(ie,T
in the general case without anUnaligned
bound), we can't delegate toT::is_bit_valid
because it requires an alignedMaybeValid<T>
. We could copy theUnalign<T>
into the local stack frame in order to ensure its alignment and then callT::is_bit_valid
on the local copy, but that could be very expensive.T
, then forT: !Unaligned
, copying into the local stack frame isn't even an option.cc @kupiakos
The text was updated successfully, but these errors were encountered: