mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
79925ac394
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)
28 lines
504 B
Rust
28 lines
504 B
Rust
#![allow(clippy::trivially_copy_pass_by_ref)]
|
|
|
|
use serde_derive::Deserialize;
|
|
|
|
macro_rules! declare_in_macro {
|
|
($with:literal) => {
|
|
#[derive(Deserialize)]
|
|
pub struct S(
|
|
#[serde(with = $with)]
|
|
#[allow(dead_code)]
|
|
i32,
|
|
);
|
|
};
|
|
}
|
|
|
|
declare_in_macro!("with");
|
|
|
|
mod with {
|
|
use serde::Deserializer;
|
|
|
|
pub fn deserialize<'de, D>(_: D) -> Result<i32, D::Error>
|
|
where
|
|
D: Deserializer<'de>,
|
|
{
|
|
unimplemented!()
|
|
}
|
|
}
|