Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traits should be clear about stability guarantees regarding UnsafeCell #352

Closed
joshlf opened this issue Sep 8, 2023 · 0 comments
Closed

Comments

@joshlf
Copy link
Member

joshlf commented Sep 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant