diff --git a/src/gen/fold.rs b/src/gen/fold.rs index c7e12c8d..a56f3143 100644 --- a/src/gen/fold.rs +++ b/src/gen/fold.rs @@ -56,10 +56,6 @@ pub trait Fold { fold_bare_fn_arg(self, i) } #[cfg(any(feature = "derive", feature = "full"))] - fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { - fold_bare_fn_arg_name(self, i) - } - #[cfg(any(feature = "derive", feature = "full"))] fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) } @@ -874,7 +870,7 @@ where attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)), name: (node.name).map(|it| { ( - f.fold_bare_fn_arg_name((it).0), + f.fold_ident((it).0), Token ! [ : ](tokens_helper(f, &(it).1.spans)), ) }), @@ -882,18 +878,6 @@ where } } #[cfg(any(feature = "derive", feature = "full"))] -pub fn fold_bare_fn_arg_name(f: &mut F, node: BareFnArgName) -> BareFnArgName -where - F: Fold + ?Sized, -{ - match node { - BareFnArgName::Named(_binding_0) => BareFnArgName::Named(f.fold_ident(_binding_0)), - BareFnArgName::Wild(_binding_0) => { - BareFnArgName::Wild(Token![_](tokens_helper(f, &_binding_0.spans))) - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] pub fn fold_bin_op(f: &mut F, node: BinOp) -> BinOp where F: Fold + ?Sized, diff --git a/src/gen/visit.rs b/src/gen/visit.rs index 8c2d31a1..fd7c3a4f 100644 --- a/src/gen/visit.rs +++ b/src/gen/visit.rs @@ -57,10 +57,6 @@ pub trait Visit<'ast> { visit_bare_fn_arg(self, i) } #[cfg(any(feature = "derive", feature = "full"))] - fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) { - visit_bare_fn_arg_name(self, i) - } - #[cfg(any(feature = "derive", feature = "full"))] fn visit_bin_op(&mut self, i: &'ast BinOp) { visit_bin_op(self, i) } @@ -875,26 +871,12 @@ where v.visit_attribute(it) } if let Some(it) = &node.name { - v.visit_bare_fn_arg_name(&(it).0); + v.visit_ident(&(it).0); tokens_helper(v, &(it).1.spans); }; v.visit_type(&node.ty); } #[cfg(any(feature = "derive", feature = "full"))] -pub fn visit_bare_fn_arg_name<'ast, V>(v: &mut V, node: &'ast BareFnArgName) -where - V: Visit<'ast> + ?Sized, -{ - match node { - BareFnArgName::Named(_binding_0) => { - v.visit_ident(_binding_0); - } - BareFnArgName::Wild(_binding_0) => { - tokens_helper(v, &_binding_0.spans); - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp) where V: Visit<'ast> + ?Sized, diff --git a/src/gen/visit_mut.rs b/src/gen/visit_mut.rs index b34a5ab6..f282333d 100644 --- a/src/gen/visit_mut.rs +++ b/src/gen/visit_mut.rs @@ -61,10 +61,6 @@ pub trait VisitMut { visit_bare_fn_arg_mut(self, i) } #[cfg(any(feature = "derive", feature = "full"))] - fn visit_bare_fn_arg_name_mut(&mut self, i: &mut BareFnArgName) { - visit_bare_fn_arg_name_mut(self, i) - } - #[cfg(any(feature = "derive", feature = "full"))] fn visit_bin_op_mut(&mut self, i: &mut BinOp) { visit_bin_op_mut(self, i) } @@ -879,26 +875,12 @@ where v.visit_attribute_mut(it) } if let Some(it) = &mut node.name { - v.visit_bare_fn_arg_name_mut(&mut (it).0); + v.visit_ident_mut(&mut (it).0); tokens_helper(v, &mut (it).1.spans); }; v.visit_type_mut(&mut node.ty); } #[cfg(any(feature = "derive", feature = "full"))] -pub fn visit_bare_fn_arg_name_mut(v: &mut V, node: &mut BareFnArgName) -where - V: VisitMut + ?Sized, -{ - match node { - BareFnArgName::Named(_binding_0) => { - v.visit_ident_mut(_binding_0); - } - BareFnArgName::Wild(_binding_0) => { - tokens_helper(v, &mut _binding_0.spans); - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] pub fn visit_bin_op_mut(v: &mut V, node: &mut BinOp) where V: VisitMut + ?Sized, diff --git a/syn.json b/syn.json index e8c2d43d..bd4bb129 100644 --- a/syn.json +++ b/syn.json @@ -156,7 +156,7 @@ "option": { "tuple": [ { - "syn": "BareFnArgName" + "proc_macro2": "Ident" }, { "token": "Colon" @@ -169,27 +169,6 @@ } } }, - { - "ident": "BareFnArgName", - "features": { - "any": [ - "derive", - "full" - ] - }, - "variants": { - "Named": [ - { - "proc_macro2": "Ident" - } - ], - "Wild": [ - { - "token": "Underscore" - } - ] - } - }, { "ident": "BinOp", "features": { diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs index 6b111ad0..c197be05 100644 --- a/tests/debug/gen.rs +++ b/tests/debug/gen.rs @@ -120,7 +120,7 @@ impl Debug for Lite { if let Some(val) = &_val.name { #[derive(RefCast)] #[repr(transparent)] - struct Print((syn::BareFnArgName, syn::token::Colon)); + struct Print((proc_macro2::Ident, syn::token::Colon)); impl Debug for Print { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("Some")?; @@ -137,24 +137,6 @@ impl Debug for Lite { formatter.finish() } } -impl Debug for Lite { - fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - let _val = &self.value; - match _val { - syn::BareFnArgName::Named(_val) => { - formatter.write_str("Named")?; - formatter.write_str("(")?; - Debug::fmt(Lite(_val), formatter)?; - formatter.write_str(")")?; - Ok(()) - } - syn::BareFnArgName::Wild(_val) => { - formatter.write_str("Wild")?; - Ok(()) - } - } - } -} impl Debug for Lite { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { let _val = &self.value;