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, FromZeroes, FromBytes, and AsBytes require that implementing types contain no UnsafeCells. However, we may lift that restriction in the future.
If any code takes our ban on UnsafeCells to mean that they can use, e.g. T: FromZeroes as a guarantee that T contains no UnsafeCells, then if we were to relax this requirement, we could allow their code to become silently unsound.
We should update our docs to be very precise and very loud about what external code may take as stability guarantees. We should also guide users towards the zerocopy API itself and discourage using our traits to gate user-written unsafe code.
The text was updated successfully, but these errors were encountered:
Currently,
FromZeroes
,FromBytes
, andAsBytes
require that implementing types contain noUnsafeCell
s. However, we may lift that restriction in the future.If any code takes our ban on
UnsafeCell
s to mean that they can use, e.g.T: FromZeroes
as a guarantee thatT
contains noUnsafeCell
s, then if we were to relax this requirement, we could allow their code to become silently unsound.We should update our docs to be very precise and very loud about what external code may take as stability guarantees. We should also guide users towards the zerocopy API itself and discourage using our traits to gate user-written unsafe code.
The text was updated successfully, but these errors were encountered: