Update generated code

This commit is contained in:
David Tolnay 2019-07-28 21:39:03 -07:00
parent c7369974df
commit c762c8cccb
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
5 changed files with 243 additions and 462 deletions

View File

@ -304,10 +304,6 @@ pub trait Fold {
fold_fn_arg(self, i)
}
#[cfg(feature = "full")]
fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl {
fold_fn_decl(self, i)
}
#[cfg(feature = "full")]
fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem {
fold_foreign_item(self, i)
}
@ -531,10 +527,6 @@ pub trait Fold {
fold_meta_name_value(self, i)
}
#[cfg(feature = "full")]
fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig {
fold_method_sig(self, i)
}
#[cfg(feature = "full")]
fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish {
fold_method_turbofish(self, i)
}
@ -658,6 +650,10 @@ pub trait Fold {
fold_return_type(self, i)
}
#[cfg(feature = "full")]
fn fold_signature(&mut self, i: Signature) -> Signature {
fold_signature(self, i)
}
#[cfg(feature = "full")]
fn fold_stmt(&mut self, i: Stmt) -> Stmt {
fold_stmt(self, i)
}
@ -1584,17 +1580,6 @@ pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
}
}
#[cfg(feature = "full")]
pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
FnDecl {
fn_token: Token![fn](tokens_helper(_visitor, &_i.fn_token.span)),
generics: _visitor.fold_generics(_i.generics),
paren_token: Paren(tokens_helper(_visitor, &_i.paren_token.span)),
inputs: FoldHelper::lift(_i.inputs, |it| _visitor.fold_fn_arg(it)),
variadic: (_i.variadic).map(|it| _visitor.fold_variadic(it)),
output: _visitor.fold_return_type(_i.output),
}
}
#[cfg(feature = "full")]
pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
match _i {
ForeignItem::Fn(_binding_0) => ForeignItem::Fn(_visitor.fold_foreign_item_fn(_binding_0)),
@ -1620,8 +1605,7 @@ pub fn fold_foreign_item_fn<V: Fold + ?Sized>(
ForeignItemFn {
attrs: FoldHelper::lift(_i.attrs, |it| _visitor.fold_attribute(it)),
vis: _visitor.fold_visibility(_i.vis),
ident: _visitor.fold_ident(_i.ident),
decl: Box::new(_visitor.fold_fn_decl(*_i.decl)),
sig: _visitor.fold_signature(_i.sig),
semi_token: Token ! [ ; ](tokens_helper(_visitor, &_i.semi_token.spans)),
}
}
@ -1799,7 +1783,7 @@ pub fn fold_impl_item_method<V: Fold + ?Sized>(
attrs: FoldHelper::lift(_i.attrs, |it| _visitor.fold_attribute(it)),
vis: _visitor.fold_visibility(_i.vis),
defaultness: (_i.defaultness).map(|it| Token![default](tokens_helper(_visitor, &it.span))),
sig: _visitor.fold_method_sig(_i.sig),
sig: _visitor.fold_signature(_i.sig),
block: _visitor.fold_block(_i.block),
}
}
@ -1930,12 +1914,7 @@ pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
ItemFn {
attrs: FoldHelper::lift(_i.attrs, |it| _visitor.fold_attribute(it)),
vis: _visitor.fold_visibility(_i.vis),
constness: (_i.constness).map(|it| Token![const](tokens_helper(_visitor, &it.span))),
asyncness: (_i.asyncness).map(|it| Token![async](tokens_helper(_visitor, &it.span))),
unsafety: (_i.unsafety).map(|it| Token![unsafe](tokens_helper(_visitor, &it.span))),
abi: (_i.abi).map(|it| _visitor.fold_abi(it)),
ident: _visitor.fold_ident(_i.ident),
decl: Box::new(_visitor.fold_fn_decl(*_i.decl)),
sig: _visitor.fold_signature(_i.sig),
block: Box::new(_visitor.fold_block(*_i.block)),
}
}
@ -2269,17 +2248,6 @@ pub fn fold_meta_name_value<V: Fold + ?Sized>(
}
}
#[cfg(feature = "full")]
pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
MethodSig {
constness: (_i.constness).map(|it| Token![const](tokens_helper(_visitor, &it.span))),
asyncness: (_i.asyncness).map(|it| Token![async](tokens_helper(_visitor, &it.span))),
unsafety: (_i.unsafety).map(|it| Token![unsafe](tokens_helper(_visitor, &it.span))),
abi: (_i.abi).map(|it| _visitor.fold_abi(it)),
ident: _visitor.fold_ident(_i.ident),
decl: _visitor.fold_fn_decl(_i.decl),
}
}
#[cfg(feature = "full")]
pub fn fold_method_turbofish<V: Fold + ?Sized>(
_visitor: &mut V,
_i: MethodTurbofish,
@ -2568,6 +2536,22 @@ pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> R
}
}
#[cfg(feature = "full")]
pub fn fold_signature<V: Fold + ?Sized>(_visitor: &mut V, _i: Signature) -> Signature {
Signature {
constness: (_i.constness).map(|it| Token![const](tokens_helper(_visitor, &it.span))),
asyncness: (_i.asyncness).map(|it| Token![async](tokens_helper(_visitor, &it.span))),
unsafety: (_i.unsafety).map(|it| Token![unsafe](tokens_helper(_visitor, &it.span))),
abi: (_i.abi).map(|it| _visitor.fold_abi(it)),
fn_token: Token![fn](tokens_helper(_visitor, &_i.fn_token.span)),
ident: _visitor.fold_ident(_i.ident),
generics: _visitor.fold_generics(_i.generics),
paren_token: Paren(tokens_helper(_visitor, &_i.paren_token.span)),
inputs: FoldHelper::lift(_i.inputs, |it| _visitor.fold_fn_arg(it)),
variadic: (_i.variadic).map(|it| _visitor.fold_variadic(it)),
output: _visitor.fold_return_type(_i.output),
}
}
#[cfg(feature = "full")]
pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
match _i {
Stmt::Local(_binding_0) => Stmt::Local(_visitor.fold_local(_binding_0)),
@ -2656,7 +2640,7 @@ pub fn fold_trait_item_method<V: Fold + ?Sized>(
) -> TraitItemMethod {
TraitItemMethod {
attrs: FoldHelper::lift(_i.attrs, |it| _visitor.fold_attribute(it)),
sig: _visitor.fold_method_sig(_i.sig),
sig: _visitor.fold_signature(_i.sig),
default: (_i.default).map(|it| _visitor.fold_block(it)),
semi_token: (_i.semi_token).map(|it| Token ! [ ; ](tokens_helper(_visitor, &it.spans))),
}

View File

@ -305,10 +305,6 @@ pub trait Visit<'ast> {
visit_fn_arg(self, i)
}
#[cfg(feature = "full")]
fn visit_fn_decl(&mut self, i: &'ast FnDecl) {
visit_fn_decl(self, i)
}
#[cfg(feature = "full")]
fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
visit_foreign_item(self, i)
}
@ -532,10 +528,6 @@ pub trait Visit<'ast> {
visit_meta_name_value(self, i)
}
#[cfg(feature = "full")]
fn visit_method_sig(&mut self, i: &'ast MethodSig) {
visit_method_sig(self, i)
}
#[cfg(feature = "full")]
fn visit_method_turbofish(&mut self, i: &'ast MethodTurbofish) {
visit_method_turbofish(self, i)
}
@ -656,6 +648,10 @@ pub trait Visit<'ast> {
visit_return_type(self, i)
}
#[cfg(feature = "full")]
fn visit_signature(&mut self, i: &'ast Signature) {
visit_signature(self, i)
}
#[cfg(feature = "full")]
fn visit_stmt(&mut self, i: &'ast Stmt) {
visit_stmt(self, i)
}
@ -1758,20 +1754,6 @@ pub fn visit_fn_arg<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast F
}
}
#[cfg(feature = "full")]
pub fn visit_fn_decl<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast FnDecl) {
tokens_helper(_visitor, &_i.fn_token.span);
_visitor.visit_generics(&_i.generics);
tokens_helper(_visitor, &_i.paren_token.span);
for el in Punctuated::pairs(&_i.inputs) {
let it = el.value();
_visitor.visit_fn_arg(it)
}
if let Some(ref it) = _i.variadic {
_visitor.visit_variadic(it)
};
_visitor.visit_return_type(&_i.output);
}
#[cfg(feature = "full")]
pub fn visit_foreign_item<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ForeignItem) {
match *_i {
ForeignItem::Fn(ref _binding_0) => {
@ -1800,8 +1782,7 @@ pub fn visit_foreign_item_fn<'ast, V: Visit<'ast> + ?Sized>(
_visitor.visit_attribute(it)
}
_visitor.visit_visibility(&_i.vis);
_visitor.visit_ident(&_i.ident);
_visitor.visit_fn_decl(&*_i.decl);
_visitor.visit_signature(&_i.sig);
tokens_helper(_visitor, &_i.semi_token.spans);
}
#[cfg(feature = "full")]
@ -2014,7 +1995,7 @@ pub fn visit_impl_item_method<'ast, V: Visit<'ast> + ?Sized>(
if let Some(ref it) = _i.defaultness {
tokens_helper(_visitor, &it.span)
};
_visitor.visit_method_sig(&_i.sig);
_visitor.visit_signature(&_i.sig);
_visitor.visit_block(&_i.block);
}
#[cfg(feature = "full")]
@ -2182,20 +2163,7 @@ pub fn visit_item_fn<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast
_visitor.visit_attribute(it)
}
_visitor.visit_visibility(&_i.vis);
if let Some(ref it) = _i.constness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.asyncness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.unsafety {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.abi {
_visitor.visit_abi(it)
};
_visitor.visit_ident(&_i.ident);
_visitor.visit_fn_decl(&*_i.decl);
_visitor.visit_signature(&_i.sig);
_visitor.visit_block(&*_i.block);
}
#[cfg(feature = "full")]
@ -2554,23 +2522,6 @@ pub fn visit_meta_name_value<'ast, V: Visit<'ast> + ?Sized>(
_visitor.visit_lit(&_i.lit);
}
#[cfg(feature = "full")]
pub fn visit_method_sig<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast MethodSig) {
if let Some(ref it) = _i.constness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.asyncness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.unsafety {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.abi {
_visitor.visit_abi(it)
};
_visitor.visit_ident(&_i.ident);
_visitor.visit_fn_decl(&_i.decl);
}
#[cfg(feature = "full")]
pub fn visit_method_turbofish<'ast, V: Visit<'ast> + ?Sized>(
_visitor: &mut V,
_i: &'ast MethodTurbofish,
@ -2930,6 +2881,33 @@ pub fn visit_return_type<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'
}
}
#[cfg(feature = "full")]
pub fn visit_signature<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Signature) {
if let Some(ref it) = _i.constness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.asyncness {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.unsafety {
tokens_helper(_visitor, &it.span)
};
if let Some(ref it) = _i.abi {
_visitor.visit_abi(it)
};
tokens_helper(_visitor, &_i.fn_token.span);
_visitor.visit_ident(&_i.ident);
_visitor.visit_generics(&_i.generics);
tokens_helper(_visitor, &_i.paren_token.span);
for el in Punctuated::pairs(&_i.inputs) {
let it = el.value();
_visitor.visit_fn_arg(it)
}
if let Some(ref it) = _i.variadic {
_visitor.visit_variadic(it)
};
_visitor.visit_return_type(&_i.output);
}
#[cfg(feature = "full")]
pub fn visit_stmt<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Stmt) {
match *_i {
Stmt::Local(ref _binding_0) => {
@ -3029,7 +3007,7 @@ pub fn visit_trait_item_method<'ast, V: Visit<'ast> + ?Sized>(
for it in &_i.attrs {
_visitor.visit_attribute(it)
}
_visitor.visit_method_sig(&_i.sig);
_visitor.visit_signature(&_i.sig);
if let Some(ref it) = _i.default {
_visitor.visit_block(it)
};

View File

@ -308,10 +308,6 @@ pub trait VisitMut {
visit_fn_arg_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_fn_decl_mut(&mut self, i: &mut FnDecl) {
visit_fn_decl_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_foreign_item_mut(&mut self, i: &mut ForeignItem) {
visit_foreign_item_mut(self, i)
}
@ -535,10 +531,6 @@ pub trait VisitMut {
visit_meta_name_value_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_method_sig_mut(&mut self, i: &mut MethodSig) {
visit_method_sig_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_method_turbofish_mut(&mut self, i: &mut MethodTurbofish) {
visit_method_turbofish_mut(self, i)
}
@ -659,6 +651,10 @@ pub trait VisitMut {
visit_return_type_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_signature_mut(&mut self, i: &mut Signature) {
visit_signature_mut(self, i)
}
#[cfg(feature = "full")]
fn visit_stmt_mut(&mut self, i: &mut Stmt) {
visit_stmt_mut(self, i)
}
@ -1734,20 +1730,6 @@ pub fn visit_fn_arg_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut FnArg)
}
}
#[cfg(feature = "full")]
pub fn visit_fn_decl_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut FnDecl) {
tokens_helper(_visitor, &mut _i.fn_token.span);
_visitor.visit_generics_mut(&mut _i.generics);
tokens_helper(_visitor, &mut _i.paren_token.span);
for mut el in Punctuated::pairs_mut(&mut _i.inputs) {
let it = el.value_mut();
_visitor.visit_fn_arg_mut(it)
}
if let Some(ref mut it) = _i.variadic {
_visitor.visit_variadic_mut(it)
};
_visitor.visit_return_type_mut(&mut _i.output);
}
#[cfg(feature = "full")]
pub fn visit_foreign_item_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut ForeignItem) {
match *_i {
ForeignItem::Fn(ref mut _binding_0) => {
@ -1773,8 +1755,7 @@ pub fn visit_foreign_item_fn_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mu
_visitor.visit_attribute_mut(it)
}
_visitor.visit_visibility_mut(&mut _i.vis);
_visitor.visit_ident_mut(&mut _i.ident);
_visitor.visit_fn_decl_mut(&mut *_i.decl);
_visitor.visit_signature_mut(&mut _i.sig);
tokens_helper(_visitor, &mut _i.semi_token.spans);
}
#[cfg(feature = "full")]
@ -1975,7 +1956,7 @@ pub fn visit_impl_item_method_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &m
if let Some(ref mut it) = _i.defaultness {
tokens_helper(_visitor, &mut it.span)
};
_visitor.visit_method_sig_mut(&mut _i.sig);
_visitor.visit_signature_mut(&mut _i.sig);
_visitor.visit_block_mut(&mut _i.block);
}
#[cfg(feature = "full")]
@ -2140,20 +2121,7 @@ pub fn visit_item_fn_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut ItemFn
_visitor.visit_attribute_mut(it)
}
_visitor.visit_visibility_mut(&mut _i.vis);
if let Some(ref mut it) = _i.constness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.asyncness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.unsafety {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.abi {
_visitor.visit_abi_mut(it)
};
_visitor.visit_ident_mut(&mut _i.ident);
_visitor.visit_fn_decl_mut(&mut *_i.decl);
_visitor.visit_signature_mut(&mut _i.sig);
_visitor.visit_block_mut(&mut *_i.block);
}
#[cfg(feature = "full")]
@ -2497,23 +2465,6 @@ pub fn visit_meta_name_value_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mu
_visitor.visit_lit_mut(&mut _i.lit);
}
#[cfg(feature = "full")]
pub fn visit_method_sig_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut MethodSig) {
if let Some(ref mut it) = _i.constness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.asyncness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.unsafety {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.abi {
_visitor.visit_abi_mut(it)
};
_visitor.visit_ident_mut(&mut _i.ident);
_visitor.visit_fn_decl_mut(&mut _i.decl);
}
#[cfg(feature = "full")]
pub fn visit_method_turbofish_mut<V: VisitMut + ?Sized>(
_visitor: &mut V,
_i: &mut MethodTurbofish,
@ -2861,6 +2812,33 @@ pub fn visit_return_type_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut Re
}
}
#[cfg(feature = "full")]
pub fn visit_signature_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut Signature) {
if let Some(ref mut it) = _i.constness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.asyncness {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.unsafety {
tokens_helper(_visitor, &mut it.span)
};
if let Some(ref mut it) = _i.abi {
_visitor.visit_abi_mut(it)
};
tokens_helper(_visitor, &mut _i.fn_token.span);
_visitor.visit_ident_mut(&mut _i.ident);
_visitor.visit_generics_mut(&mut _i.generics);
tokens_helper(_visitor, &mut _i.paren_token.span);
for mut el in Punctuated::pairs_mut(&mut _i.inputs) {
let it = el.value_mut();
_visitor.visit_fn_arg_mut(it)
}
if let Some(ref mut it) = _i.variadic {
_visitor.visit_variadic_mut(it)
};
_visitor.visit_return_type_mut(&mut _i.output);
}
#[cfg(feature = "full")]
pub fn visit_stmt_mut<V: VisitMut + ?Sized>(_visitor: &mut V, _i: &mut Stmt) {
match *_i {
Stmt::Local(ref mut _binding_0) => {
@ -2954,7 +2932,7 @@ pub fn visit_trait_item_method_mut<V: VisitMut + ?Sized>(
for it in &mut _i.attrs {
_visitor.visit_attribute_mut(it)
}
_visitor.visit_method_sig_mut(&mut _i.sig);
_visitor.visit_signature_mut(&mut _i.sig);
if let Some(ref mut it) = _i.default {
_visitor.visit_block_mut(it)
};

171
syn.json
View File

@ -2141,41 +2141,6 @@
]
}
},
{
"ident": "FnDecl",
"features": {
"any": [
"full"
]
},
"fields": {
"fn_token": {
"token": "Fn"
},
"generics": {
"syn": "Generics"
},
"paren_token": {
"group": "Paren"
},
"inputs": {
"punctuated": {
"element": {
"syn": "FnArg"
},
"punct": "Comma"
}
},
"variadic": {
"option": {
"syn": "Variadic"
}
},
"output": {
"syn": "ReturnType"
}
}
},
{
"ident": "ForeignItem",
"features": {
@ -2227,13 +2192,8 @@
"vis": {
"syn": "Visibility"
},
"ident": {
"proc_macro2": "Ident"
},
"decl": {
"box": {
"syn": "FnDecl"
}
"sig": {
"syn": "Signature"
},
"semi_token": {
"token": "Semi"
@ -2631,7 +2591,7 @@
}
},
"sig": {
"syn": "MethodSig"
"syn": "Signature"
},
"block": {
"syn": "Block"
@ -2994,33 +2954,8 @@
"vis": {
"syn": "Visibility"
},
"constness": {
"option": {
"token": "Const"
}
},
"asyncness": {
"option": {
"token": "Async"
}
},
"unsafety": {
"option": {
"token": "Unsafe"
}
},
"abi": {
"option": {
"syn": "Abi"
}
},
"ident": {
"proc_macro2": "Ident"
},
"decl": {
"box": {
"syn": "FnDecl"
}
"sig": {
"syn": "Signature"
},
"block": {
"box": {
@ -3886,42 +3821,6 @@
}
}
},
{
"ident": "MethodSig",
"features": {
"any": [
"full"
]
},
"fields": {
"constness": {
"option": {
"token": "Const"
}
},
"asyncness": {
"option": {
"token": "Async"
}
},
"unsafety": {
"option": {
"token": "Unsafe"
}
},
"abi": {
"option": {
"syn": "Abi"
}
},
"ident": {
"proc_macro2": "Ident"
},
"decl": {
"syn": "FnDecl"
}
}
},
{
"ident": "MethodTurbofish",
"features": {
@ -4726,6 +4625,64 @@
]
}
},
{
"ident": "Signature",
"features": {
"any": [
"full"
]
},
"fields": {
"constness": {
"option": {
"token": "Const"
}
},
"asyncness": {
"option": {
"token": "Async"
}
},
"unsafety": {
"option": {
"token": "Unsafe"
}
},
"abi": {
"option": {
"syn": "Abi"
}
},
"fn_token": {
"token": "Fn"
},
"ident": {
"proc_macro2": "Ident"
},
"generics": {
"syn": "Generics"
},
"paren_token": {
"group": "Paren"
},
"inputs": {
"punctuated": {
"element": {
"syn": "FnArg"
},
"punct": "Comma"
}
},
"variadic": {
"option": {
"syn": "Variadic"
}
},
"output": {
"syn": "ReturnType"
}
}
},
{
"ident": "Stmt",
"features": {
@ -4917,7 +4874,7 @@
}
},
"sig": {
"syn": "MethodSig"
"syn": "Signature"
},
"default": {
"option": {

View File

@ -2094,34 +2094,6 @@ impl Debug for Lite<syn::FnArg> {
}
}
}
impl Debug for Lite<syn::FnDecl> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;
let mut formatter = formatter.debug_struct("FnDecl");
formatter.field("generics", Lite(&_val.generics));
if !_val.inputs.is_empty() {
formatter.field("inputs", Lite(&_val.inputs));
}
if let Some(val) = &_val.variadic {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Variadic);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("variadic", Print::ref_cast(val));
}
formatter.field("output", Lite(&_val.output));
formatter.finish()
}
}
impl Debug for Lite<syn::ForeignItem> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;
@ -2132,8 +2104,7 @@ impl Debug for Lite<syn::ForeignItem> {
formatter.field("attrs", Lite(&_val.attrs));
}
formatter.field("vis", Lite(&_val.vis));
formatter.field("ident", Lite(&_val.ident));
formatter.field("decl", Lite(&_val.decl));
formatter.field("sig", Lite(&_val.sig));
formatter.finish()
}
syn::ForeignItem::Static(_val) => {
@ -2203,8 +2174,7 @@ impl Debug for Lite<syn::ForeignItemFn> {
formatter.field("attrs", Lite(&_val.attrs));
}
formatter.field("vis", Lite(&_val.vis));
formatter.field("ident", Lite(&_val.ident));
formatter.field("decl", Lite(&_val.decl));
formatter.field("sig", Lite(&_val.sig));
formatter.finish()
}
}
@ -2768,60 +2738,7 @@ impl Debug for Lite<syn::Item> {
formatter.field("attrs", Lite(&_val.attrs));
}
formatter.field("vis", Lite(&_val.vis));
if let Some(val) = &_val.constness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Const);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("constness", Print::ref_cast(val));
}
if let Some(val) = &_val.asyncness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Async);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("asyncness", Print::ref_cast(val));
}
if let Some(val) = &_val.unsafety {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Unsafe);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("unsafety", Print::ref_cast(val));
}
if let Some(val) = &_val.abi {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Abi);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("abi", Print::ref_cast(val));
}
formatter.field("ident", Lite(&_val.ident));
formatter.field("decl", Lite(&_val.decl));
formatter.field("sig", Lite(&_val.sig));
formatter.field("block", Lite(&_val.block));
formatter.finish()
}
@ -3253,60 +3170,7 @@ impl Debug for Lite<syn::ItemFn> {
formatter.field("attrs", Lite(&_val.attrs));
}
formatter.field("vis", Lite(&_val.vis));
if let Some(val) = &_val.constness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Const);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("constness", Print::ref_cast(val));
}
if let Some(val) = &_val.asyncness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Async);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("asyncness", Print::ref_cast(val));
}
if let Some(val) = &_val.unsafety {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Unsafe);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("unsafety", Print::ref_cast(val));
}
if let Some(val) = &_val.abi {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Abi);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("abi", Print::ref_cast(val));
}
formatter.field("ident", Lite(&_val.ident));
formatter.field("decl", Lite(&_val.decl));
formatter.field("sig", Lite(&_val.sig));
formatter.field("block", Lite(&_val.block));
formatter.finish()
}
@ -3919,67 +3783,6 @@ impl Debug for Lite<syn::MetaNameValue> {
formatter.finish()
}
}
impl Debug for Lite<syn::MethodSig> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;
let mut formatter = formatter.debug_struct("MethodSig");
if let Some(val) = &_val.constness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Const);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("constness", Print::ref_cast(val));
}
if let Some(val) = &_val.asyncness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Async);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("asyncness", Print::ref_cast(val));
}
if let Some(val) = &_val.unsafety {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Unsafe);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("unsafety", Print::ref_cast(val));
}
if let Some(val) = &_val.abi {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Abi);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("abi", Print::ref_cast(val));
}
formatter.field("ident", Lite(&_val.ident));
formatter.field("decl", Lite(&_val.decl));
formatter.finish()
}
}
impl Debug for Lite<syn::MethodTurbofish> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;
@ -4755,6 +4558,87 @@ impl Debug for Lite<syn::ReturnType> {
}
}
}
impl Debug for Lite<syn::Signature> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;
let mut formatter = formatter.debug_struct("Signature");
if let Some(val) = &_val.constness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Const);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("constness", Print::ref_cast(val));
}
if let Some(val) = &_val.asyncness {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Async);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("asyncness", Print::ref_cast(val));
}
if let Some(val) = &_val.unsafety {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::token::Unsafe);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
Ok(())
}
}
formatter.field("unsafety", Print::ref_cast(val));
}
if let Some(val) = &_val.abi {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Abi);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("abi", Print::ref_cast(val));
}
formatter.field("ident", Lite(&_val.ident));
formatter.field("generics", Lite(&_val.generics));
if !_val.inputs.is_empty() {
formatter.field("inputs", Lite(&_val.inputs));
}
if let Some(val) = &_val.variadic {
#[derive(RefCast)]
#[repr(transparent)]
struct Print(syn::Variadic);
impl Debug for Print {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("Some")?;
let _val = &self.0;
formatter.write_str("(")?;
Debug::fmt(Lite(_val), formatter)?;
formatter.write_str(")")?;
Ok(())
}
}
formatter.field("variadic", Print::ref_cast(val));
}
formatter.field("output", Lite(&_val.output));
formatter.finish()
}
}
impl Debug for Lite<syn::Stmt> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
let _val = &self.value;