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

Impl bytemuck traits for geometry types #925

Merged
merged 4 commits into from Jul 27, 2021
Merged

Conversation

CAD97
Copy link
Contributor

@CAD97 CAD97 commented Jun 29, 2021

Adds impls for bytemuck::Zeroable and bytemuck::Pod to the na::geometry::* types that don't already have them. All added impls just fully gate themselves on the fields' impls for these traits, so they should all be sound, unless I missed one of the following conditions:

  • The type has invalid values (semantically, in which case the traits shouldn't be impl'd); or
  • The type is not stable layout (#[repr(C)] or #[repr(transparent)]; or
  • The type is stable layout but may have padding (for any value of T or other type parameters)

I believe this should reasonably close #830.

@sebcrozet
Copy link
Member

Thank you for this PR! The CI is currently failing because some of the impls are missing trait-bounds.

@CAD97
Copy link
Contributor Author

CAD97 commented Jul 9, 2021

That's what I get for not checking --all-features 😅

Some places that are bounded on RealField could probably be loosened further to just Scalar, but that should probably wait until merged with #932.

@CAD97
Copy link
Contributor Author

CAD97 commented Jul 22, 2021

Resolved merge conflicts; should be good to merge.

@sebcrozet sebcrozet merged commit 99a79d5 into dimforge:dev Jul 27, 2021
@sebcrozet
Copy link
Member

Thanks!

@CAD97 CAD97 deleted the bytemuck branch January 13, 2024 05:01
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

Successfully merging this pull request may close these issues.

Bytemuck implementations for statically sized matrixes.
2 participants