Skip to content

Commit fdc36e5

Browse files
committed
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
1 parent 49e11ce commit fdc36e5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#![allow(clippy::trivially_copy_pass_by_ref)]
2+
3+
use serde_derive::Deserialize;
4+
5+
macro_rules! declare_in_macro {
6+
($with:literal) => {
7+
#[derive(Deserialize)]
8+
pub struct S(#[serde(with = $with)] i32);
9+
};
10+
}
11+
12+
declare_in_macro!("with");
13+
14+
mod with {
15+
use serde::Deserializer;
16+
17+
pub fn deserialize<'de, D>(_: D) -> Result<i32, D::Error>
18+
where
19+
D: Deserializer<'de>,
20+
{
21+
unimplemented!()
22+
}
23+
}

0 commit comments

Comments
 (0)