num-derive icon indicating copy to clipboard operation
num-derive copied to clipboard

Procedural macros to derive numeric traits in Rust

Results 17 num-derive issues
Sort by recently updated
recently updated
newest added

The generated code mentioned `#name` explicitly, causing `clippy::nursery` warning `use_self` to trigger on the generated code. This commit replaces usages of `#name` with `Self` where deemed applicable, and the warning...

The Float macro is referencing ::std::num::FpCategory and thus doesn't work with no_std yet. Replacing it with ::core::num::FpCategory shouldn't break any existing code but provides no_std compatibility when needed. After doing...

I've just bumped my tool-chain release up from `nightly-2021-02-20` to `nightly-2021-06-04` and a new warning arises for the `num_derive::FromPrimitive` derive macro. The Clippy lint `clippy::use_self` is thrown for the following...

When using this alongside the `xlang_abi` crate, the following error is thrown: ```rs error[E0053]: method `from_u64` has an incompatible type for trait --> modules/elf/src/lib.rs:13:10 | 13 | #[derive(FromPrimitive, ToPrimitive)] |...

Compilation fails when `i128` and `u128` aren't supported. For example, when compiling a crate with these options: `-Z build-std=core,alloc,compiler_builtins --target=x86_64-unknown-uefi`. ``` error[E0407]: method `from_i128` is not a member of trait...

Would you be okay with adding a derive macro for newtype wrappers of [`num_integer::Integer`](https://docs.rs/num-integer/0.1.44/num_integer/trait.Integer.html), even though it isn't in `num_traits`? I can create a PR for it if you're interested.

This is probably an issue best suited for rustc itself rather than this crate, but I wanted to start here in case there's anything to be done for your crate...

Hi, I'd like to use this crate for `no_std` code which apparently is not possible at the moment. Could this somehow be achieved? If this is not possible with all...

These are equally straight forward as the other numeric impls, I'm guessing there just wasn't any need for these derives so far?