diff options
Diffstat (limited to 'vendor/syn/src/gen/clone.rs')
-rw-r--r-- | vendor/syn/src/gen/clone.rs | 405 |
1 files changed, 174 insertions, 231 deletions
diff --git a/vendor/syn/src/gen/clone.rs b/vendor/syn/src/gen/clone.rs index a413e3ec7..d275f5114 100644 --- a/vendor/syn/src/gen/clone.rs +++ b/vendor/syn/src/gen/clone.rs @@ -41,6 +41,30 @@ impl Clone for Arm { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for AssocConst { + fn clone(&self) -> Self { + AssocConst { + ident: self.ident.clone(), + generics: self.generics.clone(), + eq_token: self.eq_token.clone(), + value: self.value.clone(), + } + } +} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for AssocType { + fn clone(&self) -> Self { + AssocType { + ident: self.ident.clone(), + generics: self.generics.clone(), + eq_token: self.eq_token.clone(), + ty: self.ty.clone(), + } + } +} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Copy for AttrStyle {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] @@ -57,8 +81,7 @@ impl Clone for Attribute { pound_token: self.pound_token.clone(), style: self.style.clone(), bracket_token: self.bracket_token.clone(), - path: self.path.clone(), - tokens: self.tokens.clone(), + meta: self.meta.clone(), } } } @@ -75,23 +98,24 @@ impl Clone for BareFnArg { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Copy for BinOp {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for BinOp { +impl Clone for BareVariadic { fn clone(&self) -> Self { - *self + BareVariadic { + attrs: self.attrs.clone(), + name: self.name.clone(), + dots: self.dots.clone(), + comma: self.comma.clone(), + } } } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for Binding { +impl Copy for BinOp {} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for BinOp { fn clone(&self) -> Self { - Binding { - ident: self.ident.clone(), - eq_token: self.eq_token.clone(), - ty: self.ty.clone(), - } + *self } } #[cfg(feature = "full")] @@ -137,6 +161,7 @@ impl Clone for Constraint { fn clone(&self) -> Self { Constraint { ident: self.ident.clone(), + generics: self.generics.clone(), colon_token: self.colon_token.clone(), bounds: self.bounds.clone(), } @@ -208,8 +233,6 @@ impl Clone for Expr { #[cfg(feature = "full")] Expr::Assign(v0) => Expr::Assign(v0.clone()), #[cfg(feature = "full")] - Expr::AssignOp(v0) => Expr::AssignOp(v0.clone()), - #[cfg(feature = "full")] Expr::Async(v0) => Expr::Async(v0.clone()), #[cfg(feature = "full")] Expr::Await(v0) => Expr::Await(v0.clone()), @@ -217,29 +240,29 @@ impl Clone for Expr { #[cfg(feature = "full")] Expr::Block(v0) => Expr::Block(v0.clone()), #[cfg(feature = "full")] - Expr::Box(v0) => Expr::Box(v0.clone()), - #[cfg(feature = "full")] Expr::Break(v0) => Expr::Break(v0.clone()), Expr::Call(v0) => Expr::Call(v0.clone()), Expr::Cast(v0) => Expr::Cast(v0.clone()), #[cfg(feature = "full")] Expr::Closure(v0) => Expr::Closure(v0.clone()), #[cfg(feature = "full")] + Expr::Const(v0) => Expr::Const(v0.clone()), + #[cfg(feature = "full")] Expr::Continue(v0) => Expr::Continue(v0.clone()), Expr::Field(v0) => Expr::Field(v0.clone()), #[cfg(feature = "full")] Expr::ForLoop(v0) => Expr::ForLoop(v0.clone()), - #[cfg(feature = "full")] Expr::Group(v0) => Expr::Group(v0.clone()), #[cfg(feature = "full")] Expr::If(v0) => Expr::If(v0.clone()), Expr::Index(v0) => Expr::Index(v0.clone()), #[cfg(feature = "full")] + Expr::Infer(v0) => Expr::Infer(v0.clone()), + #[cfg(feature = "full")] Expr::Let(v0) => Expr::Let(v0.clone()), Expr::Lit(v0) => Expr::Lit(v0.clone()), #[cfg(feature = "full")] Expr::Loop(v0) => Expr::Loop(v0.clone()), - #[cfg(feature = "full")] Expr::Macro(v0) => Expr::Macro(v0.clone()), #[cfg(feature = "full")] Expr::Match(v0) => Expr::Match(v0.clone()), @@ -263,8 +286,6 @@ impl Clone for Expr { Expr::TryBlock(v0) => Expr::TryBlock(v0.clone()), #[cfg(feature = "full")] Expr::Tuple(v0) => Expr::Tuple(v0.clone()), - #[cfg(feature = "full")] - Expr::Type(v0) => Expr::Type(v0.clone()), Expr::Unary(v0) => Expr::Unary(v0.clone()), #[cfg(feature = "full")] Expr::Unsafe(v0) => Expr::Unsafe(v0.clone()), @@ -273,7 +294,7 @@ impl Clone for Expr { Expr::While(v0) => Expr::While(v0.clone()), #[cfg(feature = "full")] Expr::Yield(v0) => Expr::Yield(v0.clone()), - #[cfg(any(syn_no_non_exhaustive, not(feature = "full")))] + #[cfg(not(feature = "full"))] _ => unreachable!(), } } @@ -303,18 +324,6 @@ impl Clone for ExprAssign { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ExprAssignOp { - fn clone(&self) -> Self { - ExprAssignOp { - attrs: self.attrs.clone(), - left: self.left.clone(), - op: self.op.clone(), - right: self.right.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprAsync { fn clone(&self) -> Self { ExprAsync { @@ -362,17 +371,6 @@ impl Clone for ExprBlock { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ExprBox { - fn clone(&self) -> Self { - ExprBox { - attrs: self.attrs.clone(), - box_token: self.box_token.clone(), - expr: self.expr.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprBreak { fn clone(&self) -> Self { ExprBreak { @@ -413,6 +411,8 @@ impl Clone for ExprClosure { fn clone(&self) -> Self { ExprClosure { attrs: self.attrs.clone(), + lifetimes: self.lifetimes.clone(), + constness: self.constness.clone(), movability: self.movability.clone(), asyncness: self.asyncness.clone(), capture: self.capture.clone(), @@ -426,6 +426,17 @@ impl Clone for ExprClosure { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for ExprConst { + fn clone(&self) -> Self { + ExprConst { + attrs: self.attrs.clone(), + const_token: self.const_token.clone(), + block: self.block.clone(), + } + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprContinue { fn clone(&self) -> Self { ExprContinue { @@ -462,7 +473,7 @@ impl Clone for ExprForLoop { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprGroup { fn clone(&self) -> Self { @@ -500,6 +511,16 @@ impl Clone for ExprIndex { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for ExprInfer { + fn clone(&self) -> Self { + ExprInfer { + attrs: self.attrs.clone(), + underscore_token: self.underscore_token.clone(), + } + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprLet { fn clone(&self) -> Self { ExprLet { @@ -533,7 +554,7 @@ impl Clone for ExprLoop { } } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprMacro { fn clone(&self) -> Self { @@ -599,9 +620,9 @@ impl Clone for ExprRange { fn clone(&self) -> Self { ExprRange { attrs: self.attrs.clone(), - from: self.from.clone(), + start: self.start.clone(), limits: self.limits.clone(), - to: self.to.clone(), + end: self.end.clone(), } } } @@ -612,7 +633,6 @@ impl Clone for ExprReference { ExprReference { attrs: self.attrs.clone(), and_token: self.and_token.clone(), - raw: self.raw.clone(), mutability: self.mutability.clone(), expr: self.expr.clone(), } @@ -648,6 +668,7 @@ impl Clone for ExprStruct { fn clone(&self) -> Self { ExprStruct { attrs: self.attrs.clone(), + qself: self.qself.clone(), path: self.path.clone(), brace_token: self.brace_token.clone(), fields: self.fields.clone(), @@ -689,18 +710,6 @@ impl Clone for ExprTuple { } } } -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ExprType { - fn clone(&self) -> Self { - ExprType { - attrs: self.attrs.clone(), - expr: self.expr.clone(), - colon_token: self.colon_token.clone(), - ty: self.ty.clone(), - } - } -} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ExprUnary { @@ -754,12 +763,22 @@ impl Clone for Field { Field { attrs: self.attrs.clone(), vis: self.vis.clone(), + mutability: self.mutability.clone(), ident: self.ident.clone(), colon_token: self.colon_token.clone(), ty: self.ty.clone(), } } } +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for FieldMutability { + fn clone(&self) -> Self { + match self { + FieldMutability::None => FieldMutability::None, + } + } +} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for FieldPat { @@ -846,8 +865,6 @@ impl Clone for ForeignItem { ForeignItem::Type(v0) => ForeignItem::Type(v0.clone()), ForeignItem::Macro(v0) => ForeignItem::Macro(v0.clone()), ForeignItem::Verbatim(v0) => ForeignItem::Verbatim(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), } } } @@ -899,6 +916,7 @@ impl Clone for ForeignItemType { vis: self.vis.clone(), type_token: self.type_token.clone(), ident: self.ident.clone(), + generics: self.generics.clone(), semi_token: self.semi_token.clone(), } } @@ -911,28 +929,19 @@ impl Clone for GenericArgument { GenericArgument::Lifetime(v0) => GenericArgument::Lifetime(v0.clone()), GenericArgument::Type(v0) => GenericArgument::Type(v0.clone()), GenericArgument::Const(v0) => GenericArgument::Const(v0.clone()), - GenericArgument::Binding(v0) => GenericArgument::Binding(v0.clone()), + GenericArgument::AssocType(v0) => GenericArgument::AssocType(v0.clone()), + GenericArgument::AssocConst(v0) => GenericArgument::AssocConst(v0.clone()), GenericArgument::Constraint(v0) => GenericArgument::Constraint(v0.clone()), } } } -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for GenericMethodArgument { - fn clone(&self) -> Self { - match self { - GenericMethodArgument::Type(v0) => GenericMethodArgument::Type(v0.clone()), - GenericMethodArgument::Const(v0) => GenericMethodArgument::Const(v0.clone()), - } - } -} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for GenericParam { fn clone(&self) -> Self { match self { - GenericParam::Type(v0) => GenericParam::Type(v0.clone()), GenericParam::Lifetime(v0) => GenericParam::Lifetime(v0.clone()), + GenericParam::Type(v0) => GenericParam::Type(v0.clone()), GenericParam::Const(v0) => GenericParam::Const(v0.clone()), } } @@ -955,12 +964,10 @@ impl Clone for ImplItem { fn clone(&self) -> Self { match self { ImplItem::Const(v0) => ImplItem::Const(v0.clone()), - ImplItem::Method(v0) => ImplItem::Method(v0.clone()), + ImplItem::Fn(v0) => ImplItem::Fn(v0.clone()), ImplItem::Type(v0) => ImplItem::Type(v0.clone()), ImplItem::Macro(v0) => ImplItem::Macro(v0.clone()), ImplItem::Verbatim(v0) => ImplItem::Verbatim(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), } } } @@ -974,6 +981,7 @@ impl Clone for ImplItemConst { defaultness: self.defaultness.clone(), const_token: self.const_token.clone(), ident: self.ident.clone(), + generics: self.generics.clone(), colon_token: self.colon_token.clone(), ty: self.ty.clone(), eq_token: self.eq_token.clone(), @@ -984,25 +992,25 @@ impl Clone for ImplItemConst { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ImplItemMacro { +impl Clone for ImplItemFn { fn clone(&self) -> Self { - ImplItemMacro { + ImplItemFn { attrs: self.attrs.clone(), - mac: self.mac.clone(), - semi_token: self.semi_token.clone(), + vis: self.vis.clone(), + defaultness: self.defaultness.clone(), + sig: self.sig.clone(), + block: self.block.clone(), } } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ImplItemMethod { +impl Clone for ImplItemMacro { fn clone(&self) -> Self { - ImplItemMethod { + ImplItemMacro { attrs: self.attrs.clone(), - vis: self.vis.clone(), - defaultness: self.defaultness.clone(), - sig: self.sig.clone(), - block: self.block.clone(), + mac: self.mac.clone(), + semi_token: self.semi_token.clone(), } } } @@ -1023,6 +1031,13 @@ impl Clone for ImplItemType { } } } +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for ImplRestriction { + fn clone(&self) -> Self { + match *self {} + } +} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for Index { @@ -1045,7 +1060,6 @@ impl Clone for Item { Item::ForeignMod(v0) => Item::ForeignMod(v0.clone()), Item::Impl(v0) => Item::Impl(v0.clone()), Item::Macro(v0) => Item::Macro(v0.clone()), - Item::Macro2(v0) => Item::Macro2(v0.clone()), Item::Mod(v0) => Item::Mod(v0.clone()), Item::Static(v0) => Item::Static(v0.clone()), Item::Struct(v0) => Item::Struct(v0.clone()), @@ -1055,8 +1069,6 @@ impl Clone for Item { Item::Union(v0) => Item::Union(v0.clone()), Item::Use(v0) => Item::Use(v0.clone()), Item::Verbatim(v0) => Item::Verbatim(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), } } } @@ -1069,6 +1081,7 @@ impl Clone for ItemConst { vis: self.vis.clone(), const_token: self.const_token.clone(), ident: self.ident.clone(), + generics: self.generics.clone(), colon_token: self.colon_token.clone(), ty: self.ty.clone(), eq_token: self.eq_token.clone(), @@ -1125,6 +1138,7 @@ impl Clone for ItemForeignMod { fn clone(&self) -> Self { ItemForeignMod { attrs: self.attrs.clone(), + unsafety: self.unsafety.clone(), abi: self.abi.clone(), brace_token: self.brace_token.clone(), items: self.items.clone(), @@ -1162,24 +1176,12 @@ impl Clone for ItemMacro { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for ItemMacro2 { - fn clone(&self) -> Self { - ItemMacro2 { - attrs: self.attrs.clone(), - vis: self.vis.clone(), - macro_token: self.macro_token.clone(), - ident: self.ident.clone(), - rules: self.rules.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for ItemMod { fn clone(&self) -> Self { ItemMod { attrs: self.attrs.clone(), vis: self.vis.clone(), + unsafety: self.unsafety.clone(), mod_token: self.mod_token.clone(), ident: self.ident.clone(), content: self.content.clone(), @@ -1229,6 +1231,7 @@ impl Clone for ItemTrait { vis: self.vis.clone(), unsafety: self.unsafety.clone(), auto_token: self.auto_token.clone(), + restriction: self.restriction.clone(), trait_token: self.trait_token.clone(), ident: self.ident.clone(), generics: self.generics.clone(), @@ -1311,9 +1314,9 @@ impl Clone for Label { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for LifetimeDef { +impl Clone for LifetimeParam { fn clone(&self) -> Self { - LifetimeDef { + LifetimeParam { attrs: self.attrs.clone(), lifetime: self.lifetime.clone(), colon_token: self.colon_token.clone(), @@ -1358,6 +1361,17 @@ impl Clone for Local { } } } +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for LocalInit { + fn clone(&self) -> Self { + LocalInit { + eq_token: self.eq_token.clone(), + expr: self.expr.clone(), + diverge: self.diverge.clone(), + } + } +} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for Macro { @@ -1408,8 +1422,8 @@ impl Clone for MetaList { fn clone(&self) -> Self { MetaList { path: self.path.clone(), - paren_token: self.paren_token.clone(), - nested: self.nested.clone(), + delimiter: self.delimiter.clone(), + tokens: self.tokens.clone(), } } } @@ -1420,29 +1434,7 @@ impl Clone for MetaNameValue { MetaNameValue { path: self.path.clone(), eq_token: self.eq_token.clone(), - lit: self.lit.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for MethodTurbofish { - fn clone(&self) -> Self { - MethodTurbofish { - colon2_token: self.colon2_token.clone(), - lt_token: self.lt_token.clone(), - args: self.args.clone(), - gt_token: self.gt_token.clone(), - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for NestedMeta { - fn clone(&self) -> Self { - match self { - NestedMeta::Meta(v0) => NestedMeta::Meta(v0.clone()), - NestedMeta::Lit(v0) => NestedMeta::Lit(v0.clone()), + value: self.value.clone(), } } } @@ -1462,11 +1454,12 @@ impl Clone for ParenthesizedGenericArguments { impl Clone for Pat { fn clone(&self) -> Self { match self { - Pat::Box(v0) => Pat::Box(v0.clone()), + Pat::Const(v0) => Pat::Const(v0.clone()), Pat::Ident(v0) => Pat::Ident(v0.clone()), Pat::Lit(v0) => Pat::Lit(v0.clone()), Pat::Macro(v0) => Pat::Macro(v0.clone()), Pat::Or(v0) => Pat::Or(v0.clone()), + Pat::Paren(v0) => Pat::Paren(v0.clone()), Pat::Path(v0) => Pat::Path(v0.clone()), Pat::Range(v0) => Pat::Range(v0.clone()), Pat::Reference(v0) => Pat::Reference(v0.clone()), @@ -1478,19 +1471,6 @@ impl Clone for Pat { Pat::Type(v0) => Pat::Type(v0.clone()), Pat::Verbatim(v0) => Pat::Verbatim(v0.clone()), Pat::Wild(v0) => Pat::Wild(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PatBox { - fn clone(&self) -> Self { - PatBox { - attrs: self.attrs.clone(), - box_token: self.box_token.clone(), - pat: self.pat.clone(), } } } @@ -1509,26 +1489,6 @@ impl Clone for PatIdent { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PatLit { - fn clone(&self) -> Self { - PatLit { - attrs: self.attrs.clone(), - expr: self.expr.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PatMacro { - fn clone(&self) -> Self { - PatMacro { - attrs: self.attrs.clone(), - mac: self.mac.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for PatOr { fn clone(&self) -> Self { PatOr { @@ -1540,24 +1500,12 @@ impl Clone for PatOr { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PatPath { - fn clone(&self) -> Self { - PatPath { - attrs: self.attrs.clone(), - qself: self.qself.clone(), - path: self.path.clone(), - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PatRange { +impl Clone for PatParen { fn clone(&self) -> Self { - PatRange { + PatParen { attrs: self.attrs.clone(), - lo: self.lo.clone(), - limits: self.limits.clone(), - hi: self.hi.clone(), + paren_token: self.paren_token.clone(), + pat: self.pat.clone(), } } } @@ -1600,10 +1548,11 @@ impl Clone for PatStruct { fn clone(&self) -> Self { PatStruct { attrs: self.attrs.clone(), + qself: self.qself.clone(), path: self.path.clone(), brace_token: self.brace_token.clone(), fields: self.fields.clone(), - dot2_token: self.dot2_token.clone(), + rest: self.rest.clone(), } } } @@ -1624,8 +1573,10 @@ impl Clone for PatTupleStruct { fn clone(&self) -> Self { PatTupleStruct { attrs: self.attrs.clone(), + qself: self.qself.clone(), path: self.path.clone(), - pat: self.pat.clone(), + paren_token: self.paren_token.clone(), + elems: self.elems.clone(), } } } @@ -1686,17 +1637,6 @@ impl Clone for PathSegment { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for PredicateEq { - fn clone(&self) -> Self { - PredicateEq { - lhs_ty: self.lhs_ty.clone(), - eq_token: self.eq_token.clone(), - rhs_ty: self.rhs_ty.clone(), - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for PredicateLifetime { fn clone(&self) -> Self { PredicateLifetime { @@ -1750,6 +1690,8 @@ impl Clone for Receiver { reference: self.reference.clone(), mutability: self.mutability.clone(), self_token: self.self_token.clone(), + colon_token: self.colon_token.clone(), + ty: self.ty.clone(), } } } @@ -1784,13 +1726,34 @@ impl Clone for Signature { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for StaticMutability { + fn clone(&self) -> Self { + match self { + StaticMutability::Mut(v0) => StaticMutability::Mut(v0.clone()), + StaticMutability::None => StaticMutability::None, + } + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for Stmt { fn clone(&self) -> Self { match self { Stmt::Local(v0) => Stmt::Local(v0.clone()), Stmt::Item(v0) => Stmt::Item(v0.clone()), - Stmt::Expr(v0) => Stmt::Expr(v0.clone()), - Stmt::Semi(v0, v1) => Stmt::Semi(v0.clone(), v1.clone()), + Stmt::Expr(v0, v1) => Stmt::Expr(v0.clone(), v1.clone()), + Stmt::Macro(v0) => Stmt::Macro(v0.clone()), + } + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] +impl Clone for StmtMacro { + fn clone(&self) -> Self { + StmtMacro { + attrs: self.attrs.clone(), + mac: self.mac.clone(), + semi_token: self.semi_token.clone(), } } } @@ -1822,12 +1785,10 @@ impl Clone for TraitItem { fn clone(&self) -> Self { match self { TraitItem::Const(v0) => TraitItem::Const(v0.clone()), - TraitItem::Method(v0) => TraitItem::Method(v0.clone()), + TraitItem::Fn(v0) => TraitItem::Fn(v0.clone()), TraitItem::Type(v0) => TraitItem::Type(v0.clone()), TraitItem::Macro(v0) => TraitItem::Macro(v0.clone()), TraitItem::Verbatim(v0) => TraitItem::Verbatim(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), } } } @@ -1839,6 +1800,7 @@ impl Clone for TraitItemConst { attrs: self.attrs.clone(), const_token: self.const_token.clone(), ident: self.ident.clone(), + generics: self.generics.clone(), colon_token: self.colon_token.clone(), ty: self.ty.clone(), default: self.default.clone(), @@ -1848,23 +1810,23 @@ impl Clone for TraitItemConst { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for TraitItemMacro { +impl Clone for TraitItemFn { fn clone(&self) -> Self { - TraitItemMacro { + TraitItemFn { attrs: self.attrs.clone(), - mac: self.mac.clone(), + sig: self.sig.clone(), + default: self.default.clone(), semi_token: self.semi_token.clone(), } } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for TraitItemMethod { +impl Clone for TraitItemMacro { fn clone(&self) -> Self { - TraitItemMethod { + TraitItemMacro { attrs: self.attrs.clone(), - sig: self.sig.clone(), - default: self.default.clone(), + mac: self.mac.clone(), semi_token: self.semi_token.clone(), } } @@ -1905,8 +1867,6 @@ impl Clone for Type { Type::TraitObject(v0) => Type::TraitObject(v0.clone()), Type::Tuple(v0) => Type::Tuple(v0.clone()), Type::Verbatim(v0) => Type::Verbatim(v0.clone()), - #[cfg(syn_no_non_exhaustive)] - _ => unreachable!(), } } } @@ -2004,6 +1964,7 @@ impl Clone for TypeParamBound { match self { TypeParamBound::Trait(v0) => TypeParamBound::Trait(v0.clone()), TypeParamBound::Lifetime(v0) => TypeParamBound::Lifetime(v0.clone()), + TypeParamBound::Verbatim(v0) => TypeParamBound::Verbatim(v0.clone()), } } } @@ -2154,13 +2115,15 @@ impl Clone for UseTree { } } } -#[cfg(any(feature = "derive", feature = "full"))] +#[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for Variadic { fn clone(&self) -> Self { Variadic { attrs: self.attrs.clone(), + pat: self.pat.clone(), dots: self.dots.clone(), + comma: self.comma.clone(), } } } @@ -2178,24 +2141,6 @@ impl Clone for Variant { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for VisCrate { - fn clone(&self) -> Self { - VisCrate { - crate_token: self.crate_token.clone(), - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] -impl Clone for VisPublic { - fn clone(&self) -> Self { - VisPublic { - pub_token: self.pub_token.clone(), - } - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))] impl Clone for VisRestricted { fn clone(&self) -> Self { VisRestricted { @@ -2212,7 +2157,6 @@ impl Clone for Visibility { fn clone(&self) -> Self { match self { Visibility::Public(v0) => Visibility::Public(v0.clone()), - Visibility::Crate(v0) => Visibility::Crate(v0.clone()), Visibility::Restricted(v0) => Visibility::Restricted(v0.clone()), Visibility::Inherited => Visibility::Inherited, } @@ -2233,9 +2177,8 @@ impl Clone for WhereClause { impl Clone for WherePredicate { fn clone(&self) -> Self { match self { - WherePredicate::Type(v0) => WherePredicate::Type(v0.clone()), WherePredicate::Lifetime(v0) => WherePredicate::Lifetime(v0.clone()), - WherePredicate::Eq(v0) => WherePredicate::Eq(v0.clone()), + WherePredicate::Type(v0) => WherePredicate::Type(v0.clone()), } } } |