From 3455abf814d097cc3bfe3f666650b92b4b6bbaf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Przytu=C5=82a?= Date: Fri, 10 May 2024 07:30:09 +0200 Subject: [PATCH] treewide: silence mock structs unused warning With a new version of Rust toolchain, our never constructed structs used for testing macros began to trigger rustc warnings. They are silenced explicitly using #[allow(unused)]. --- scylla-cql/src/types/serialize/row.rs | 1 + scylla-cql/src/types/serialize/value.rs | 2 ++ scylla/tests/integration/hygiene.rs | 1 + 3 files changed, 4 insertions(+) diff --git a/scylla-cql/src/types/serialize/row.rs b/scylla-cql/src/types/serialize/row.rs index f4c107bad3..c8f04cc6bc 100644 --- a/scylla-cql/src/types/serialize/row.rs +++ b/scylla-cql/src/types/serialize/row.rs @@ -1141,6 +1141,7 @@ mod tests { // Do not remove. It's not used in tests but we keep it here to check that // we properly ignore warnings about unused variables, unnecessary `mut`s // etc. that usually pop up when generating code for empty structs. + #[allow(unused)] #[derive(SerializeRow)] #[scylla(crate = crate)] struct TestRowWithNoColumns {} diff --git a/scylla-cql/src/types/serialize/value.rs b/scylla-cql/src/types/serialize/value.rs index 39403f3c48..6f917f8de4 100644 --- a/scylla-cql/src/types/serialize/value.rs +++ b/scylla-cql/src/types/serialize/value.rs @@ -2038,6 +2038,7 @@ mod tests { // Do not remove. It's not used in tests but we keep it here to check that // we properly ignore warnings about unused variables, unnecessary `mut`s // etc. that usually pop up when generating code for empty structs. + #[allow(unused)] #[derive(SerializeCql)] #[scylla(crate = crate)] struct TestUdtWithNoFields {} @@ -2596,6 +2597,7 @@ mod tests { assert_eq!(reference, udt); } + #[allow(unused)] #[derive(SerializeCql, Debug)] #[scylla(crate = crate, flavor = "enforce_order", skip_name_checks)] struct TestUdtWithSkippedNameChecks { diff --git a/scylla/tests/integration/hygiene.rs b/scylla/tests/integration/hygiene.rs index 85c753589e..a3b400f474 100644 --- a/scylla/tests/integration/hygiene.rs +++ b/scylla/tests/integration/hygiene.rs @@ -64,6 +64,7 @@ macro_rules! test_crate { assert_eq!(sv, sv2); } + #[allow(unused)] #[derive(_scylla::macros::SerializeCql, _scylla::macros::SerializeRow)] #[scylla(crate = _scylla)] struct TestStructNew {