diff --git a/borsh/src/de/mod.rs b/borsh/src/de/mod.rs index 34e150da8..19279cc72 100644 --- a/borsh/src/de/mod.rs +++ b/borsh/src/de/mod.rs @@ -779,6 +779,7 @@ fn array_deserialization_doesnt_leak() { static DESERIALIZE_COUNT: AtomicUsize = AtomicUsize::new(0); static DROP_COUNT: AtomicUsize = AtomicUsize::new(0); + #[allow(unused)] struct MyType(u8); impl BorshDeserialize for MyType { fn deserialize_reader(reader: &mut R) -> Result { diff --git a/borsh/tests/schema/container_extension/test_max_size.rs b/borsh/tests/schema/container_extension/test_max_size.rs index 676601009..d179b0e83 100644 --- a/borsh/tests/schema/container_extension/test_max_size.rs +++ b/borsh/tests/schema/container_extension/test_max_size.rs @@ -94,6 +94,7 @@ fn max_serialized_size_derived_types() { } #[derive(BorshSchema)] + #[allow(unused)] pub struct Unnamed(usize, [u8; 15]); #[derive(BorshSchema)] @@ -106,6 +107,7 @@ fn max_serialized_size_derived_types() { } #[derive(BorshSchema)] + #[allow(unused)] struct Recursive(Option>); test_ok::(0); diff --git a/borsh/tests/schema/container_extension/test_schema_validate.rs b/borsh/tests/schema/container_extension/test_schema_validate.rs index 94caa0fc9..91d02f793 100644 --- a/borsh/tests/schema/container_extension/test_schema_validate.rs +++ b/borsh/tests/schema/container_extension/test_schema_validate.rs @@ -27,16 +27,20 @@ fn validate_for_derived_types() { } #[derive(BorshSchema)] + #[allow(unused)] pub struct Unnamed(usize, [u8; 15]); #[derive(BorshSchema)] + #[allow(unused)] struct Recursive(Option>); #[derive(BorshSchema)] + #[allow(unused)] struct RecursiveSequence(Vec); // thankfully, this one cannot be constructed #[derive(BorshSchema)] + #[allow(unused)] struct RecursiveArray(Box<[RecursiveArray; 3]>); test_ok::(); diff --git a/borsh/tests/schema/test_simple_structs.rs b/borsh/tests/schema/test_simple_structs.rs index 244247ed2..f8a325e17 100644 --- a/borsh/tests/schema/test_simple_structs.rs +++ b/borsh/tests/schema/test_simple_structs.rs @@ -54,6 +54,7 @@ pub fn simple_struct() { #[test] pub fn tuple_struct() { #[derive(borsh::BorshSchema)] + #[allow(unused)] struct A(u64, String); assert_eq!("A".to_string(), A::declaration()); let mut defs = Default::default(); diff --git a/borsh/tests/tests.rs b/borsh/tests/tests.rs index 5d4993f1e..daaac5ec2 100644 --- a/borsh/tests/tests.rs +++ b/borsh/tests/tests.rs @@ -17,6 +17,7 @@ mod custom_reader { #[cfg(feature = "derive")] mod compile_derives { mod test_macro_namespace_collisions; + #[allow(unused)] mod test_generic_structs; mod test_generic_enums; mod test_recursive_structs;