Skip to content

Add support for bytemuck traits#100

Merged
bors[bot] merged 5 commits intorust-num:masterfrom
bradleyharden:add_bytemuck_support
Apr 29, 2022
Merged

Add support for bytemuck traits#100
bors[bot] merged 5 commits intorust-num:masterfrom
bradleyharden:add_bytemuck_support

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?

@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