Lokathor/bytemuck

Implement `Pod` for `num::Complex`?

bradleyharden opened this issue · 2 comments

This is probably not going to work, but I thought I would ask.

It would be nice if Pod were implemented for num::Complex<T> where T: Pod. It fits all the criteria. But I doubt the num crate would be willing to depend on bytemuck. As an alternative, maybe you could add an optional dependency and feature for num? It's just an idea. It may not work.

num also defines BigInt and BigUint, but I don't know if they would qualify for Pod.

I feel like the normal procedure with a crate that mostly offers a trait is that each crate providing a particular data type should be the one that depends on the trait's crate and then implements the trait.

Particularly with an unsafe trait that depends on the precise layout of a type, I wouldn't want them to change anything in a patch update that would break the rules.

I don't know the maintainers of num at all, but they might be willing to accept bytemuck as an optional dependency. Particularly since this crate is 1.0 and had gone quite some time without any breaking changes (for a rust crate).

For anyone who comes across this, see rust-num/num-complex#99.