From 79925ac3947483013ba8136e43bc0449b99bd10c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 22 Oct 2024 11:10:51 -0700 Subject: [PATCH] Ignore dead_code warning in regression test warning: field `0` is never read --> test_suite/tests/regression/issue2846.rs:8:45 | 8 | pub struct S(#[serde(with = $with)] i32); | - field in this struct ^^^ ... 12 | declare_in_macro!("with"); | ------------------------- in this macro invocation | = help: consider removing this field = note: `#[warn(dead_code)]` on by default = note: this warning originates in the macro `declare_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info) --- test_suite/tests/regression/issue2846.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test_suite/tests/regression/issue2846.rs b/test_suite/tests/regression/issue2846.rs index c4a91330..c5258a5b 100644 --- a/test_suite/tests/regression/issue2846.rs +++ b/test_suite/tests/regression/issue2846.rs @@ -5,7 +5,11 @@ use serde_derive::Deserialize; macro_rules! declare_in_macro { ($with:literal) => { #[derive(Deserialize)] - pub struct S(#[serde(with = $with)] i32); + pub struct S( + #[serde(with = $with)] + #[allow(dead_code)] + i32, + ); }; }