mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-17 17:21:04 +00:00
Add regression test for issue 2846
error[E0425]: cannot find value `__e` in this scope
--> test_suite/tests/regression/issue2846.rs:12:19
|
12 | declare_in_macro!("with");
| ^^^^^^ not found in this scope
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
#![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)] 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!()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user