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

Add support for bytemuck traits #100

Merged
merged 5 commits into from
Apr 29, 2022

Conversation

bradleyharden
Copy link
Contributor

bytemuck seems to be the de facto standard crate for safe
transmuting. Because Complex<T> is repr(C), it would satisfy the
requirements for Zeroable and Pod, as long as T satisfies them as
well.

Add optional implemenations of Zeroable and Pod, gated behind the
bytemuck feature.

Closes #99

`bytemuck` seems to be the *de facto* standard crate for safe
transmuting. Because `Complex<T>` is `repr(C)`, it would satisfy the
requirements for `Zeroable` and `Pod`, as long as `T` satisfies them as
well.

Add optional implemenations of `Zeroable` and `Pod`, gated behind the
`bytemuck` feature.
@bradleyharden
Copy link
Contributor Author

@cuviper or anyone else, would you have a second to take a look at this?

@cuviper
Copy link
Member

cuviper commented Feb 22, 2022

Can you add the feature to ci/test_full.sh?
(Trivial as it is, we still ought to test it...)

@bradleyharden
Copy link
Contributor Author

@cuviper, done

@bradleyharden
Copy link
Contributor Author

Pinging this again. I think it's ready.

@bradleyharden
Copy link
Contributor Author

Another bump. @cuviper?

ci/test_full.sh Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@cuviper
Copy link
Member

cuviper commented Apr 29, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 29, 2022

@bors bors bot merged commit 106811f into rust-num:master Apr 29, 2022
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.

Safe transmuting for Complex<T> with bytemuck
2 participants