From 846f865de2e94408e0edc6a2c6863c063cd234be Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 7 Feb 2024 22:15:14 -0800 Subject: [PATCH] Ignore dead_code warnings in test warning: trait `AssertNotSerdeSerialize` is never used --> test_suite/tests/test_serde_path.rs:39:7 | 39 | trait AssertNotSerdeSerialize {} | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: trait `AssertNotSerdeDeserialize` is never used --> test_suite/tests/test_serde_path.rs:43:7 | 43 | trait AssertNotSerdeDeserialize<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ warning: method `serialize` is never used --> test_suite/tests/test_serde_path.rs:31:12 | 30 | pub trait Serialize { | --------- method in this trait 31 | fn serialize(&self, serializer: S) -> Result; | ^^^^^^^^^ warning: associated function `deserialize` is never used --> test_suite/tests/test_serde_path.rs:35:12 | 34 | pub trait Deserialize<'a>: Sized { | ----------- associated function in this trait 35 | fn deserialize>(deserializer: D) -> Result; | ^^^^^^^^^^^ --- test_suite/tests/test_serde_path.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test_suite/tests/test_serde_path.rs b/test_suite/tests/test_serde_path.rs index a87e49d9..127b557e 100644 --- a/test_suite/tests/test_serde_path.rs +++ b/test_suite/tests/test_serde_path.rs @@ -27,19 +27,21 @@ mod fake_serde { { } + #[allow(dead_code)] pub trait Serialize { fn serialize(&self, serializer: S) -> Result; } + #[allow(dead_code)] pub trait Deserialize<'a>: Sized { fn deserialize>(deserializer: D) -> Result; } } -trait AssertNotSerdeSerialize {} +pub trait AssertNotSerdeSerialize {} impl AssertNotSerdeSerialize for T {} -trait AssertNotSerdeDeserialize<'a> {} +pub trait AssertNotSerdeDeserialize<'a> {} impl<'a, T: serde::Deserialize<'a>> AssertNotSerdeDeserialize<'a> for T {}