Skip to content

Commit

Permalink
Ignore dead_code warning in regression test
Browse files Browse the repository at this point in the history
    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)
  • Loading branch information
dtolnay committed Oct 22, 2024
1 parent b60e409 commit 79925ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test_suite/tests/regression/issue2846.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
};
}

Expand Down

0 comments on commit 79925ac

Please sign in to comment.