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
The TryFromBytes derive for unions requires that Self: NoCell, due to the safety obligations of Ptr::project in its implementation of is_bit_valid. By contrast, the derives for FromZeros and FromBytes on unions do not require Self: NoCell.
We would like to make TryFromBytes a super-trait of FromZeros, but (as we discovered in #952) this mismatch in requirements presents us with a trilemma:
don't make TryFromBytes a super-trait of FromZeros
find a way to remove the NoCell requirements on the TryFromBytes derive for unions
propagate the NoCell requirement on unions to the derives for FromZeros and FromBytes
Short-Term Resolution
We:
don't formally make TryFromBytes a super-trait of FromZeros, but we document that this relationship may be required in the future
propagate the NoCell requirement on unions to the derives for FromZeros and FromBytes
Making FromZeros: TryFromBytes may create future breakage for customers manually implementing FromZeros, but this workflow is explicitly documented as unsupported.
The text was updated successfully, but these errors were encountered:
The
TryFromBytes
derive for unions requires thatSelf: NoCell
, due to the safety obligations ofPtr::project
in its implementation ofis_bit_valid
. By contrast, the derives forFromZeros
andFromBytes
on unions do not requireSelf: NoCell
.We would like to make
TryFromBytes
a super-trait ofFromZeros
, but (as we discovered in #952) this mismatch in requirements presents us with a trilemma:TryFromBytes
a super-trait ofFromZeros
NoCell
requirements on theTryFromBytes
derive for unionsNoCell
requirement on unions to the derives forFromZeros
andFromBytes
Short-Term Resolution
We:
TryFromBytes
a super-trait ofFromZeros
, but we document that this relationship may be required in the futureNoCell
requirement on unions to the derives forFromZeros
andFromBytes
Making
FromZeros: TryFromBytes
may create future breakage for customers manually implementingFromZeros
, but this workflow is explicitly documented as unsupported.The text was updated successfully, but these errors were encountered: