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

Using non-zero integers with atomic 0.6 #39

Open
nazar-pc opened this issue Jan 19, 2024 · 4 comments
Open

Using non-zero integers with atomic 0.6 #39

nazar-pc opened this issue Jan 19, 2024 · 4 comments

Comments

@nazar-pc
Copy link

What prevents me from upgrading to 0.6 right now is that bytemuck::Pod isn't implemented for NonZero* types. Is it expected or side-effect of the implementation?

Maybe a separate trait is needed that is auto-implemented for types that implement Pod, but can also be implemented for other types like NonZero*?

@Amanieu
Copy link
Owner

Amanieu commented Jan 19, 2024

Maybe we could use NoUninit instead of Pod. Would you be willing to write up a PR for this?

@nazar-pc
Copy link
Author

That sounds like a solution, I'll try to create a PR this weekend

@CryZe
Copy link

CryZe commented Jan 19, 2024

It already uses NoUninit:

impl<T: NoUninit> Atomic<T> {

@Amanieu
Copy link
Owner

Amanieu commented Jan 19, 2024

NonZero* types implement NoUninit: https://docs.rs/bytemuck/latest/bytemuck/trait.NoUninit.html

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

3 participants