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

Relax the generic requirements for NoUninit and CheckedBitPattern derives. #252

Open
stegaBOB opened this issue Jul 1, 2024 · 1 comment

Comments

@stegaBOB
Copy link

stegaBOB commented Jul 1, 2024

For NoUninit, if the struct itself is #[repr(packed)] with align 1 and the generic is also NoUninit, I believe it should be safe to derive since there shouldn't be any padding bytes and the rest of the checks should run for the the remaining fields in the derive macro. I would be happy to add this change if I'm not overlooking something.

As for CheckedBitPattern, I'm not entirely sure if there is some specific reason why generics aren't supported. From my understanding there's nothing in the trait that inherently prevents something like this. I would be happy to attempt a macro change for this as well.

@Lokathor
Copy link
Owner

Lokathor commented Jul 8, 2024

I believe that this simply hasn't been added yet, and that it would be sound for someone to add it in.

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

2 participants