Skip to content

Commit

Permalink
Add regression test for issue 2846
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
dtolnay committed Oct 22, 2024
1 parent 49e11ce commit fdc36e5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test_suite/tests/regression/issue2846.rs
Original file line number Diff line number Diff line change
@@ -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!()
}
}

0 comments on commit fdc36e5

Please sign in to comment.