Skip to content

Commit

Permalink
ci: silence new 1.77 warnings about tuple struct fields unused
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Mar 25, 2024
1 parent db870ac commit f2acfc3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions borsh/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<R: Read>(reader: &mut R) -> Result<Self> {
Expand Down
2 changes: 2 additions & 0 deletions borsh/tests/schema/container_extension/test_max_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fn max_serialized_size_derived_types() {
}

#[derive(BorshSchema)]
#[allow(unused)]
pub struct Unnamed(usize, [u8; 15]);

#[derive(BorshSchema)]
Expand All @@ -106,6 +107,7 @@ fn max_serialized_size_derived_types() {
}

#[derive(BorshSchema)]
#[allow(unused)]
struct Recursive(Option<Box<Recursive>>);

test_ok::<Empty>(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Box<Recursive>>);

#[derive(BorshSchema)]
#[allow(unused)]
struct RecursiveSequence(Vec<RecursiveSequence>);

// thankfully, this one cannot be constructed
#[derive(BorshSchema)]
#[allow(unused)]
struct RecursiveArray(Box<[RecursiveArray; 3]>);

test_ok::<Empty>();
Expand Down
1 change: 1 addition & 0 deletions borsh/tests/schema/test_simple_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions borsh/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f2acfc3

Please sign in to comment.