diff --git a/CHANGELOG.md b/CHANGELOG.md index 27c366b..1e96b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- add `alloc` requirement to `num-traits` feature [#363] + +[#363]: https://github.com/recmo/uint/pull/363 + ## [1.12.1] - 2024-03-12 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index 045830b..d7ad848 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ruint" description = "Unsigned integer type with const-generic bit length" -version = "1.12.1" +version = "1.12.2" keywords = ["uint"] categories = ["mathematics"] include = [".cargo/", "src/", "README.md"] @@ -125,6 +125,7 @@ ark-ff-04 = ["dep:ark-ff-04"] bn-rs = ["dep:bn-rs", "std"] fastrlp = ["dep:fastrlp", "alloc"] num-bigint = ["dep:num-bigint", "alloc"] +num-traits = ["dep:num-traits", "alloc"] parity-scale-codec = ["dep:parity-scale-codec", "alloc"] primitive-types = ["dep:primitive-types"] proptest = ["dep:proptest", "std"] # TODO: change to "alloc" on the next proptest release (>1.2.0) diff --git a/src/support/num_traits.rs b/src/support/num_traits.rs index f74f857..e73d5f9 100644 --- a/src/support/num_traits.rs +++ b/src/support/num_traits.rs @@ -26,6 +26,9 @@ use num_traits::{ CheckedEuclid, Euclid, Inv, MulAdd, MulAddAssign, Num, NumCast, }; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + // TODO: AsPrimitive // Note. We can not implement `NumBytes` as it requires T to be `AsMut<[u8]>`.