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
Summing Vec<Complex<T>>: difference between core::num::Zero and num::traits::Zero #126
Comments
I don't think it would be enough to just give them identical signatures -- they are still distinct traits from different sources. |
I ran into this issue, and made changes that fix it for me, but aren't ready to merge yet - PeterHatch@59c70e9 Most importantly it needs to still work when not using nightly; I'm not sure how to detect that - I'd appreciate pointers, and may look into it more. And the same thing should be done for One. |
Perhaps we should just provide our own |
How would that Also, would we want the Um, and I now notice that the standard library issue for stabilizing |
We would provide them through our own trait, say As for stabilization -- |
Oh, right, that For stabilization, I ran across https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md which suggests using cargo features - to quote that section:
I think using a feature to enable extending Also, I don't think it will be as simple as
It seems quite possible to have |
OK, sure, we can plan on keeping |
std Zero is now gone. |
I wanted to sum a
Vec<Complex<T>>
usingstd::iter::Iterator::sum()
, which has the signature:It turns out that the trait
core::num::Zero
referred to in the signature is different fromnum::traits::Zero
defined inrust-num
. You get an error like:I think it is quite unfortunate that these two traits are not the same. They should be.
A MWE to show the error would be:
The text was updated successfully, but these errors were encountered: