-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Description
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 toT::is_bit_valid. - For
T: !Unaligned(ie,Tin the general case without anUnalignedbound), we can't delegate toT::is_bit_validbecause 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_validon the local copy, but that could be very expensive. - If we add support for unsized
T, then forT: !Unaligned, copying into the local stack frame isn't even an option.
cc @kupiakos
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels