From 467fac574ef23daa3a89f959ab929382b0fdb390 Mon Sep 17 00:00:00 2001 From: ordian Date: Sat, 10 Aug 2024 10:54:56 +0200 Subject: [PATCH 1/2] fix compile errors with new Rust --- bounded-collections/src/bounded_btree_map.rs | 3 ++- bounded-collections/src/bounded_btree_set.rs | 3 ++- bounded-collections/src/bounded_vec.rs | 5 +++-- fixed-hash/src/hash.rs | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bounded-collections/src/bounded_btree_map.rs b/bounded-collections/src/bounded_btree_map.rs index de975801..c3369c19 100644 --- a/bounded-collections/src/bounded_btree_map.rs +++ b/bounded-collections/src/bounded_btree_map.rs @@ -655,10 +655,11 @@ mod test { #[test] #[cfg(feature = "std")] fn container_can_derive_hash() { - #[derive(Hash)] + #[derive(Hash, Default)] struct Foo { bar: u8, map: BoundedBTreeMap>, } + let _foo = Foo::default(); } } diff --git a/bounded-collections/src/bounded_btree_set.rs b/bounded-collections/src/bounded_btree_set.rs index c966bce8..e651c862 100644 --- a/bounded-collections/src/bounded_btree_set.rs +++ b/bounded-collections/src/bounded_btree_set.rs @@ -579,11 +579,12 @@ mod test { #[test] #[cfg(feature = "std")] fn container_can_derive_hash() { - #[derive(Hash)] + #[derive(Hash, Default)] struct Foo { bar: u8, set: BoundedBTreeSet>, } + let _foo = Foo::default(); } #[cfg(feature = "serde")] diff --git a/bounded-collections/src/bounded_vec.rs b/bounded-collections/src/bounded_vec.rs index c8c7e87a..4d56971e 100644 --- a/bounded-collections/src/bounded_vec.rs +++ b/bounded-collections/src/bounded_vec.rs @@ -925,7 +925,7 @@ where #[cfg(all(test, feature = "std"))] mod test { use super::*; - use crate::{bounded_vec, ConstU32, ConstU8}; + use crate::{bounded_vec, ConstU32}; use codec::CompactLen; #[test] @@ -1363,8 +1363,9 @@ mod test { #[derive(Hash)] struct Foo<'a> { bar: u8, - slice: BoundedSlice<'a, usize, ConstU8<8>>, + slice: BoundedSlice<'a, usize, ConstU32<4>>, map: BoundedVec>, } + let _foo = Foo { bar: 42, slice: BoundedSlice::truncate_from(&[0, 1][..]), map: BoundedVec::default() }; } } diff --git a/fixed-hash/src/hash.rs b/fixed-hash/src/hash.rs index 20f3864e..a5c1ed41 100644 --- a/fixed-hash/src/hash.rs +++ b/fixed-hash/src/hash.rs @@ -255,7 +255,6 @@ macro_rules! construct_fixed_hash { impl $crate::core_::marker::Copy for $name {} - #[cfg_attr(feature = "dev", allow(expl_impl_clone_on_copy))] impl $crate::core_::clone::Clone for $name { fn clone(&self) -> $name { *self From 7e09e22d6b38babf554bb12770200c62c379c39e Mon Sep 17 00:00:00 2001 From: ordian Date: Sat, 10 Aug 2024 14:45:15 +0200 Subject: [PATCH 2/2] try fixing rug compilation error --- uint/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uint/Cargo.toml b/uint/Cargo.toml index 36f3de1b..44bef00d 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -34,7 +34,10 @@ criterion = "0.5.1" num-bigint = "0.4.0" [target.'cfg(all(unix, target_arch = "x86_64"))'.dev-dependencies] -rug = { version = "1.6.0", default-features = false, features = ["integer"] } +rug = { version = "1.6.0", default-features = false, features = [ + "integer", + "std", +] } [[bench]] name = "bigint"