Do std::num::Int and Float need to implement Copy?

As there’s currently no standard multiple-precision float library, only the built-in types, I tried to create bindings for GNU MPFR in Rust. It’s almost a perfect fit for the Float type, and I think it would be great if functions could be made generic over any float type.

However, Float requires Copy, and as the MPFR types need to implement Drop to conform to the library, I can’t create a Float implementation for them.

I can’t think of why a Float would also need to be Copy. Is there a reason behind it?

The task of providing for generics for numerics was basically removed from the libstd, see for example the numerics reform rfc. You should use the num crate instead (or other third party project?), it’s available on crates.io as well.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.