diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 390d60fb..9184e75a 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -571,6 +571,15 @@ macro_rules! tuple_impls { marker: PhantomData<($($name,)+)>, } + impl< + $($name: Deserialize,)+ + > $visitor<$($name,)+> { + fn new() -> Self { + $visitor { marker: PhantomData } + } + } + + impl< $($name: Deserialize,)+ > Visitor for $visitor<$($name,)+> { @@ -601,7 +610,7 @@ macro_rules! tuple_impls { fn deserialize(deserializer: &mut D) -> Result<($($name,)+), D::Error> where D: Deserializer, { - deserializer.visit_tuple($visitor { marker: PhantomData }) + deserializer.visit_tuple($visitor::new()) } } )+