1// This file is @generated by syn-internal-codegen.
2// It is not intended for manual editing.
3
4#![allow(clippy::clone_on_copy, clippy::expl_impl_clone_on_copy)]
5use crate::*;
6#[cfg(any(feature = "derive", feature = "full"))]
7#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
8impl Clone for Abi {
9 fn clone(&self) -> Self {
10 Abi {
11 extern_token: self.extern_token.clone(),
12 name: self.name.clone(),
13 }
14 }
15}
16#[cfg(any(feature = "derive", feature = "full"))]
17#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
18impl Clone for AngleBracketedGenericArguments {
19 fn clone(&self) -> Self {
20 AngleBracketedGenericArguments {
21 colon2_token: self.colon2_token.clone(),
22 lt_token: self.lt_token.clone(),
23 args: self.args.clone(),
24 gt_token: self.gt_token.clone(),
25 }
26 }
27}
28#[cfg(feature = "full")]
29#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
30impl Clone for Arm {
31 fn clone(&self) -> Self {
32 Arm {
33 attrs: self.attrs.clone(),
34 pat: self.pat.clone(),
35 guard: self.guard.clone(),
36 fat_arrow_token: self.fat_arrow_token.clone(),
37 body: self.body.clone(),
38 comma: self.comma.clone(),
39 }
40 }
41}
42#[cfg(any(feature = "derive", feature = "full"))]
43#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
44impl Copy for AttrStyle {}
45#[cfg(any(feature = "derive", feature = "full"))]
46#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
47impl Clone for AttrStyle {
48 fn clone(&self) -> Self {
49 *self
50 }
51}
52#[cfg(any(feature = "derive", feature = "full"))]
53#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
54impl Clone for Attribute {
55 fn clone(&self) -> Self {
56 Attribute {
57 pound_token: self.pound_token.clone(),
58 style: self.style.clone(),
59 bracket_token: self.bracket_token.clone(),
60 path: self.path.clone(),
61 tokens: self.tokens.clone(),
62 }
63 }
64}
65#[cfg(any(feature = "derive", feature = "full"))]
66#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
67impl Clone for BareFnArg {
68 fn clone(&self) -> Self {
69 BareFnArg {
70 attrs: self.attrs.clone(),
71 name: self.name.clone(),
72 ty: self.ty.clone(),
73 }
74 }
75}
76#[cfg(any(feature = "derive", feature = "full"))]
77#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
78impl Copy for BinOp {}
79#[cfg(any(feature = "derive", feature = "full"))]
80#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
81impl Clone for BinOp {
82 fn clone(&self) -> Self {
83 *self
84 }
85}
86#[cfg(any(feature = "derive", feature = "full"))]
87#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
88impl Clone for Binding {
89 fn clone(&self) -> Self {
90 Binding {
91 ident: self.ident.clone(),
92 eq_token: self.eq_token.clone(),
93 ty: self.ty.clone(),
94 }
95 }
96}
97#[cfg(feature = "full")]
98#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
99impl Clone for Block {
100 fn clone(&self) -> Self {
101 Block {
102 brace_token: self.brace_token.clone(),
103 stmts: self.stmts.clone(),
104 }
105 }
106}
107#[cfg(any(feature = "derive", feature = "full"))]
108#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
109impl Clone for BoundLifetimes {
110 fn clone(&self) -> Self {
111 BoundLifetimes {
112 for_token: self.for_token.clone(),
113 lt_token: self.lt_token.clone(),
114 lifetimes: self.lifetimes.clone(),
115 gt_token: self.gt_token.clone(),
116 }
117 }
118}
119#[cfg(any(feature = "derive", feature = "full"))]
120#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
121impl Clone for ConstParam {
122 fn clone(&self) -> Self {
123 ConstParam {
124 attrs: self.attrs.clone(),
125 const_token: self.const_token.clone(),
126 ident: self.ident.clone(),
127 colon_token: self.colon_token.clone(),
128 ty: self.ty.clone(),
129 eq_token: self.eq_token.clone(),
130 default: self.default.clone(),
131 }
132 }
133}
134#[cfg(any(feature = "derive", feature = "full"))]
135#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
136impl Clone for Constraint {
137 fn clone(&self) -> Self {
138 Constraint {
139 ident: self.ident.clone(),
140 colon_token: self.colon_token.clone(),
141 bounds: self.bounds.clone(),
142 }
143 }
144}
145#[cfg(feature = "derive")]
146#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
147impl Clone for Data {
148 fn clone(&self) -> Self {
149 match self {
150 Data::Struct(v0: &DataStruct) => Data::Struct(v0.clone()),
151 Data::Enum(v0: &DataEnum) => Data::Enum(v0.clone()),
152 Data::Union(v0: &DataUnion) => Data::Union(v0.clone()),
153 }
154 }
155}
156#[cfg(feature = "derive")]
157#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
158impl Clone for DataEnum {
159 fn clone(&self) -> Self {
160 DataEnum {
161 enum_token: self.enum_token.clone(),
162 brace_token: self.brace_token.clone(),
163 variants: self.variants.clone(),
164 }
165 }
166}
167#[cfg(feature = "derive")]
168#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
169impl Clone for DataStruct {
170 fn clone(&self) -> Self {
171 DataStruct {
172 struct_token: self.struct_token.clone(),
173 fields: self.fields.clone(),
174 semi_token: self.semi_token.clone(),
175 }
176 }
177}
178#[cfg(feature = "derive")]
179#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
180impl Clone for DataUnion {
181 fn clone(&self) -> Self {
182 DataUnion {
183 union_token: self.union_token.clone(),
184 fields: self.fields.clone(),
185 }
186 }
187}
188#[cfg(feature = "derive")]
189#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
190impl Clone for DeriveInput {
191 fn clone(&self) -> Self {
192 DeriveInput {
193 attrs: self.attrs.clone(),
194 vis: self.vis.clone(),
195 ident: self.ident.clone(),
196 generics: self.generics.clone(),
197 data: self.data.clone(),
198 }
199 }
200}
201#[cfg(any(feature = "derive", feature = "full"))]
202#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
203impl Clone for Expr {
204 fn clone(&self) -> Self {
205 match self {
206 #[cfg(feature = "full")]
207 Expr::Array(v0) => Expr::Array(v0.clone()),
208 #[cfg(feature = "full")]
209 Expr::Assign(v0) => Expr::Assign(v0.clone()),
210 #[cfg(feature = "full")]
211 Expr::AssignOp(v0) => Expr::AssignOp(v0.clone()),
212 #[cfg(feature = "full")]
213 Expr::Async(v0) => Expr::Async(v0.clone()),
214 #[cfg(feature = "full")]
215 Expr::Await(v0) => Expr::Await(v0.clone()),
216 Expr::Binary(v0) => Expr::Binary(v0.clone()),
217 #[cfg(feature = "full")]
218 Expr::Block(v0) => Expr::Block(v0.clone()),
219 #[cfg(feature = "full")]
220 Expr::Box(v0) => Expr::Box(v0.clone()),
221 #[cfg(feature = "full")]
222 Expr::Break(v0) => Expr::Break(v0.clone()),
223 Expr::Call(v0) => Expr::Call(v0.clone()),
224 Expr::Cast(v0) => Expr::Cast(v0.clone()),
225 #[cfg(feature = "full")]
226 Expr::Closure(v0) => Expr::Closure(v0.clone()),
227 #[cfg(feature = "full")]
228 Expr::Continue(v0) => Expr::Continue(v0.clone()),
229 Expr::Field(v0) => Expr::Field(v0.clone()),
230 #[cfg(feature = "full")]
231 Expr::ForLoop(v0) => Expr::ForLoop(v0.clone()),
232 #[cfg(feature = "full")]
233 Expr::Group(v0) => Expr::Group(v0.clone()),
234 #[cfg(feature = "full")]
235 Expr::If(v0) => Expr::If(v0.clone()),
236 Expr::Index(v0) => Expr::Index(v0.clone()),
237 #[cfg(feature = "full")]
238 Expr::Let(v0) => Expr::Let(v0.clone()),
239 Expr::Lit(v0) => Expr::Lit(v0.clone()),
240 #[cfg(feature = "full")]
241 Expr::Loop(v0) => Expr::Loop(v0.clone()),
242 #[cfg(feature = "full")]
243 Expr::Macro(v0) => Expr::Macro(v0.clone()),
244 #[cfg(feature = "full")]
245 Expr::Match(v0) => Expr::Match(v0.clone()),
246 #[cfg(feature = "full")]
247 Expr::MethodCall(v0) => Expr::MethodCall(v0.clone()),
248 Expr::Paren(v0) => Expr::Paren(v0.clone()),
249 Expr::Path(v0) => Expr::Path(v0.clone()),
250 #[cfg(feature = "full")]
251 Expr::Range(v0) => Expr::Range(v0.clone()),
252 #[cfg(feature = "full")]
253 Expr::Reference(v0) => Expr::Reference(v0.clone()),
254 #[cfg(feature = "full")]
255 Expr::Repeat(v0) => Expr::Repeat(v0.clone()),
256 #[cfg(feature = "full")]
257 Expr::Return(v0) => Expr::Return(v0.clone()),
258 #[cfg(feature = "full")]
259 Expr::Struct(v0) => Expr::Struct(v0.clone()),
260 #[cfg(feature = "full")]
261 Expr::Try(v0) => Expr::Try(v0.clone()),
262 #[cfg(feature = "full")]
263 Expr::TryBlock(v0) => Expr::TryBlock(v0.clone()),
264 #[cfg(feature = "full")]
265 Expr::Tuple(v0) => Expr::Tuple(v0.clone()),
266 #[cfg(feature = "full")]
267 Expr::Type(v0) => Expr::Type(v0.clone()),
268 Expr::Unary(v0) => Expr::Unary(v0.clone()),
269 #[cfg(feature = "full")]
270 Expr::Unsafe(v0) => Expr::Unsafe(v0.clone()),
271 Expr::Verbatim(v0) => Expr::Verbatim(v0.clone()),
272 #[cfg(feature = "full")]
273 Expr::While(v0) => Expr::While(v0.clone()),
274 #[cfg(feature = "full")]
275 Expr::Yield(v0) => Expr::Yield(v0.clone()),
276 #[cfg(any(syn_no_non_exhaustive, not(feature = "full")))]
277 _ => unreachable!(),
278 }
279 }
280}
281#[cfg(feature = "full")]
282#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
283impl Clone for ExprArray {
284 fn clone(&self) -> Self {
285 ExprArray {
286 attrs: self.attrs.clone(),
287 bracket_token: self.bracket_token.clone(),
288 elems: self.elems.clone(),
289 }
290 }
291}
292#[cfg(feature = "full")]
293#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
294impl Clone for ExprAssign {
295 fn clone(&self) -> Self {
296 ExprAssign {
297 attrs: self.attrs.clone(),
298 left: self.left.clone(),
299 eq_token: self.eq_token.clone(),
300 right: self.right.clone(),
301 }
302 }
303}
304#[cfg(feature = "full")]
305#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
306impl Clone for ExprAssignOp {
307 fn clone(&self) -> Self {
308 ExprAssignOp {
309 attrs: self.attrs.clone(),
310 left: self.left.clone(),
311 op: self.op.clone(),
312 right: self.right.clone(),
313 }
314 }
315}
316#[cfg(feature = "full")]
317#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
318impl Clone for ExprAsync {
319 fn clone(&self) -> Self {
320 ExprAsync {
321 attrs: self.attrs.clone(),
322 async_token: self.async_token.clone(),
323 capture: self.capture.clone(),
324 block: self.block.clone(),
325 }
326 }
327}
328#[cfg(feature = "full")]
329#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
330impl Clone for ExprAwait {
331 fn clone(&self) -> Self {
332 ExprAwait {
333 attrs: self.attrs.clone(),
334 base: self.base.clone(),
335 dot_token: self.dot_token.clone(),
336 await_token: self.await_token.clone(),
337 }
338 }
339}
340#[cfg(any(feature = "derive", feature = "full"))]
341#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
342impl Clone for ExprBinary {
343 fn clone(&self) -> Self {
344 ExprBinary {
345 attrs: self.attrs.clone(),
346 left: self.left.clone(),
347 op: self.op.clone(),
348 right: self.right.clone(),
349 }
350 }
351}
352#[cfg(feature = "full")]
353#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
354impl Clone for ExprBlock {
355 fn clone(&self) -> Self {
356 ExprBlock {
357 attrs: self.attrs.clone(),
358 label: self.label.clone(),
359 block: self.block.clone(),
360 }
361 }
362}
363#[cfg(feature = "full")]
364#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
365impl Clone for ExprBox {
366 fn clone(&self) -> Self {
367 ExprBox {
368 attrs: self.attrs.clone(),
369 box_token: self.box_token.clone(),
370 expr: self.expr.clone(),
371 }
372 }
373}
374#[cfg(feature = "full")]
375#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
376impl Clone for ExprBreak {
377 fn clone(&self) -> Self {
378 ExprBreak {
379 attrs: self.attrs.clone(),
380 break_token: self.break_token.clone(),
381 label: self.label.clone(),
382 expr: self.expr.clone(),
383 }
384 }
385}
386#[cfg(any(feature = "derive", feature = "full"))]
387#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
388impl Clone for ExprCall {
389 fn clone(&self) -> Self {
390 ExprCall {
391 attrs: self.attrs.clone(),
392 func: self.func.clone(),
393 paren_token: self.paren_token.clone(),
394 args: self.args.clone(),
395 }
396 }
397}
398#[cfg(any(feature = "derive", feature = "full"))]
399#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
400impl Clone for ExprCast {
401 fn clone(&self) -> Self {
402 ExprCast {
403 attrs: self.attrs.clone(),
404 expr: self.expr.clone(),
405 as_token: self.as_token.clone(),
406 ty: self.ty.clone(),
407 }
408 }
409}
410#[cfg(feature = "full")]
411#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
412impl Clone for ExprClosure {
413 fn clone(&self) -> Self {
414 ExprClosure {
415 attrs: self.attrs.clone(),
416 movability: self.movability.clone(),
417 asyncness: self.asyncness.clone(),
418 capture: self.capture.clone(),
419 or1_token: self.or1_token.clone(),
420 inputs: self.inputs.clone(),
421 or2_token: self.or2_token.clone(),
422 output: self.output.clone(),
423 body: self.body.clone(),
424 }
425 }
426}
427#[cfg(feature = "full")]
428#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
429impl Clone for ExprContinue {
430 fn clone(&self) -> Self {
431 ExprContinue {
432 attrs: self.attrs.clone(),
433 continue_token: self.continue_token.clone(),
434 label: self.label.clone(),
435 }
436 }
437}
438#[cfg(any(feature = "derive", feature = "full"))]
439#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
440impl Clone for ExprField {
441 fn clone(&self) -> Self {
442 ExprField {
443 attrs: self.attrs.clone(),
444 base: self.base.clone(),
445 dot_token: self.dot_token.clone(),
446 member: self.member.clone(),
447 }
448 }
449}
450#[cfg(feature = "full")]
451#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
452impl Clone for ExprForLoop {
453 fn clone(&self) -> Self {
454 ExprForLoop {
455 attrs: self.attrs.clone(),
456 label: self.label.clone(),
457 for_token: self.for_token.clone(),
458 pat: self.pat.clone(),
459 in_token: self.in_token.clone(),
460 expr: self.expr.clone(),
461 body: self.body.clone(),
462 }
463 }
464}
465#[cfg(feature = "full")]
466#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
467impl Clone for ExprGroup {
468 fn clone(&self) -> Self {
469 ExprGroup {
470 attrs: self.attrs.clone(),
471 group_token: self.group_token.clone(),
472 expr: self.expr.clone(),
473 }
474 }
475}
476#[cfg(feature = "full")]
477#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
478impl Clone for ExprIf {
479 fn clone(&self) -> Self {
480 ExprIf {
481 attrs: self.attrs.clone(),
482 if_token: self.if_token.clone(),
483 cond: self.cond.clone(),
484 then_branch: self.then_branch.clone(),
485 else_branch: self.else_branch.clone(),
486 }
487 }
488}
489#[cfg(any(feature = "derive", feature = "full"))]
490#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
491impl Clone for ExprIndex {
492 fn clone(&self) -> Self {
493 ExprIndex {
494 attrs: self.attrs.clone(),
495 expr: self.expr.clone(),
496 bracket_token: self.bracket_token.clone(),
497 index: self.index.clone(),
498 }
499 }
500}
501#[cfg(feature = "full")]
502#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
503impl Clone for ExprLet {
504 fn clone(&self) -> Self {
505 ExprLet {
506 attrs: self.attrs.clone(),
507 let_token: self.let_token.clone(),
508 pat: self.pat.clone(),
509 eq_token: self.eq_token.clone(),
510 expr: self.expr.clone(),
511 }
512 }
513}
514#[cfg(any(feature = "derive", feature = "full"))]
515#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
516impl Clone for ExprLit {
517 fn clone(&self) -> Self {
518 ExprLit {
519 attrs: self.attrs.clone(),
520 lit: self.lit.clone(),
521 }
522 }
523}
524#[cfg(feature = "full")]
525#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
526impl Clone for ExprLoop {
527 fn clone(&self) -> Self {
528 ExprLoop {
529 attrs: self.attrs.clone(),
530 label: self.label.clone(),
531 loop_token: self.loop_token.clone(),
532 body: self.body.clone(),
533 }
534 }
535}
536#[cfg(feature = "full")]
537#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
538impl Clone for ExprMacro {
539 fn clone(&self) -> Self {
540 ExprMacro {
541 attrs: self.attrs.clone(),
542 mac: self.mac.clone(),
543 }
544 }
545}
546#[cfg(feature = "full")]
547#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
548impl Clone for ExprMatch {
549 fn clone(&self) -> Self {
550 ExprMatch {
551 attrs: self.attrs.clone(),
552 match_token: self.match_token.clone(),
553 expr: self.expr.clone(),
554 brace_token: self.brace_token.clone(),
555 arms: self.arms.clone(),
556 }
557 }
558}
559#[cfg(feature = "full")]
560#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
561impl Clone for ExprMethodCall {
562 fn clone(&self) -> Self {
563 ExprMethodCall {
564 attrs: self.attrs.clone(),
565 receiver: self.receiver.clone(),
566 dot_token: self.dot_token.clone(),
567 method: self.method.clone(),
568 turbofish: self.turbofish.clone(),
569 paren_token: self.paren_token.clone(),
570 args: self.args.clone(),
571 }
572 }
573}
574#[cfg(any(feature = "derive", feature = "full"))]
575#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
576impl Clone for ExprParen {
577 fn clone(&self) -> Self {
578 ExprParen {
579 attrs: self.attrs.clone(),
580 paren_token: self.paren_token.clone(),
581 expr: self.expr.clone(),
582 }
583 }
584}
585#[cfg(any(feature = "derive", feature = "full"))]
586#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
587impl Clone for ExprPath {
588 fn clone(&self) -> Self {
589 ExprPath {
590 attrs: self.attrs.clone(),
591 qself: self.qself.clone(),
592 path: self.path.clone(),
593 }
594 }
595}
596#[cfg(feature = "full")]
597#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
598impl Clone for ExprRange {
599 fn clone(&self) -> Self {
600 ExprRange {
601 attrs: self.attrs.clone(),
602 from: self.from.clone(),
603 limits: self.limits.clone(),
604 to: self.to.clone(),
605 }
606 }
607}
608#[cfg(feature = "full")]
609#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
610impl Clone for ExprReference {
611 fn clone(&self) -> Self {
612 ExprReference {
613 attrs: self.attrs.clone(),
614 and_token: self.and_token.clone(),
615 raw: self.raw.clone(),
616 mutability: self.mutability.clone(),
617 expr: self.expr.clone(),
618 }
619 }
620}
621#[cfg(feature = "full")]
622#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
623impl Clone for ExprRepeat {
624 fn clone(&self) -> Self {
625 ExprRepeat {
626 attrs: self.attrs.clone(),
627 bracket_token: self.bracket_token.clone(),
628 expr: self.expr.clone(),
629 semi_token: self.semi_token.clone(),
630 len: self.len.clone(),
631 }
632 }
633}
634#[cfg(feature = "full")]
635#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
636impl Clone for ExprReturn {
637 fn clone(&self) -> Self {
638 ExprReturn {
639 attrs: self.attrs.clone(),
640 return_token: self.return_token.clone(),
641 expr: self.expr.clone(),
642 }
643 }
644}
645#[cfg(feature = "full")]
646#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
647impl Clone for ExprStruct {
648 fn clone(&self) -> Self {
649 ExprStruct {
650 attrs: self.attrs.clone(),
651 path: self.path.clone(),
652 brace_token: self.brace_token.clone(),
653 fields: self.fields.clone(),
654 dot2_token: self.dot2_token.clone(),
655 rest: self.rest.clone(),
656 }
657 }
658}
659#[cfg(feature = "full")]
660#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
661impl Clone for ExprTry {
662 fn clone(&self) -> Self {
663 ExprTry {
664 attrs: self.attrs.clone(),
665 expr: self.expr.clone(),
666 question_token: self.question_token.clone(),
667 }
668 }
669}
670#[cfg(feature = "full")]
671#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
672impl Clone for ExprTryBlock {
673 fn clone(&self) -> Self {
674 ExprTryBlock {
675 attrs: self.attrs.clone(),
676 try_token: self.try_token.clone(),
677 block: self.block.clone(),
678 }
679 }
680}
681#[cfg(feature = "full")]
682#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
683impl Clone for ExprTuple {
684 fn clone(&self) -> Self {
685 ExprTuple {
686 attrs: self.attrs.clone(),
687 paren_token: self.paren_token.clone(),
688 elems: self.elems.clone(),
689 }
690 }
691}
692#[cfg(feature = "full")]
693#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
694impl Clone for ExprType {
695 fn clone(&self) -> Self {
696 ExprType {
697 attrs: self.attrs.clone(),
698 expr: self.expr.clone(),
699 colon_token: self.colon_token.clone(),
700 ty: self.ty.clone(),
701 }
702 }
703}
704#[cfg(any(feature = "derive", feature = "full"))]
705#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
706impl Clone for ExprUnary {
707 fn clone(&self) -> Self {
708 ExprUnary {
709 attrs: self.attrs.clone(),
710 op: self.op.clone(),
711 expr: self.expr.clone(),
712 }
713 }
714}
715#[cfg(feature = "full")]
716#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
717impl Clone for ExprUnsafe {
718 fn clone(&self) -> Self {
719 ExprUnsafe {
720 attrs: self.attrs.clone(),
721 unsafe_token: self.unsafe_token.clone(),
722 block: self.block.clone(),
723 }
724 }
725}
726#[cfg(feature = "full")]
727#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
728impl Clone for ExprWhile {
729 fn clone(&self) -> Self {
730 ExprWhile {
731 attrs: self.attrs.clone(),
732 label: self.label.clone(),
733 while_token: self.while_token.clone(),
734 cond: self.cond.clone(),
735 body: self.body.clone(),
736 }
737 }
738}
739#[cfg(feature = "full")]
740#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
741impl Clone for ExprYield {
742 fn clone(&self) -> Self {
743 ExprYield {
744 attrs: self.attrs.clone(),
745 yield_token: self.yield_token.clone(),
746 expr: self.expr.clone(),
747 }
748 }
749}
750#[cfg(any(feature = "derive", feature = "full"))]
751#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
752impl Clone for Field {
753 fn clone(&self) -> Self {
754 Field {
755 attrs: self.attrs.clone(),
756 vis: self.vis.clone(),
757 ident: self.ident.clone(),
758 colon_token: self.colon_token.clone(),
759 ty: self.ty.clone(),
760 }
761 }
762}
763#[cfg(feature = "full")]
764#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
765impl Clone for FieldPat {
766 fn clone(&self) -> Self {
767 FieldPat {
768 attrs: self.attrs.clone(),
769 member: self.member.clone(),
770 colon_token: self.colon_token.clone(),
771 pat: self.pat.clone(),
772 }
773 }
774}
775#[cfg(feature = "full")]
776#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
777impl Clone for FieldValue {
778 fn clone(&self) -> Self {
779 FieldValue {
780 attrs: self.attrs.clone(),
781 member: self.member.clone(),
782 colon_token: self.colon_token.clone(),
783 expr: self.expr.clone(),
784 }
785 }
786}
787#[cfg(any(feature = "derive", feature = "full"))]
788#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
789impl Clone for Fields {
790 fn clone(&self) -> Self {
791 match self {
792 Fields::Named(v0: &FieldsNamed) => Fields::Named(v0.clone()),
793 Fields::Unnamed(v0: &FieldsUnnamed) => Fields::Unnamed(v0.clone()),
794 Fields::Unit => Fields::Unit,
795 }
796 }
797}
798#[cfg(any(feature = "derive", feature = "full"))]
799#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
800impl Clone for FieldsNamed {
801 fn clone(&self) -> Self {
802 FieldsNamed {
803 brace_token: self.brace_token.clone(),
804 named: self.named.clone(),
805 }
806 }
807}
808#[cfg(any(feature = "derive", feature = "full"))]
809#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
810impl Clone for FieldsUnnamed {
811 fn clone(&self) -> Self {
812 FieldsUnnamed {
813 paren_token: self.paren_token.clone(),
814 unnamed: self.unnamed.clone(),
815 }
816 }
817}
818#[cfg(feature = "full")]
819#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
820impl Clone for File {
821 fn clone(&self) -> Self {
822 File {
823 shebang: self.shebang.clone(),
824 attrs: self.attrs.clone(),
825 items: self.items.clone(),
826 }
827 }
828}
829#[cfg(feature = "full")]
830#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
831impl Clone for FnArg {
832 fn clone(&self) -> Self {
833 match self {
834 FnArg::Receiver(v0: &Receiver) => FnArg::Receiver(v0.clone()),
835 FnArg::Typed(v0: &PatType) => FnArg::Typed(v0.clone()),
836 }
837 }
838}
839#[cfg(feature = "full")]
840#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
841impl Clone for ForeignItem {
842 fn clone(&self) -> Self {
843 match self {
844 ForeignItem::Fn(v0: &ForeignItemFn) => ForeignItem::Fn(v0.clone()),
845 ForeignItem::Static(v0: &ForeignItemStatic) => ForeignItem::Static(v0.clone()),
846 ForeignItem::Type(v0: &ForeignItemType) => ForeignItem::Type(v0.clone()),
847 ForeignItem::Macro(v0: &ForeignItemMacro) => ForeignItem::Macro(v0.clone()),
848 ForeignItem::Verbatim(v0: &TokenStream) => ForeignItem::Verbatim(v0.clone()),
849 #[cfg(syn_no_non_exhaustive)]
850 _ => unreachable!(),
851 }
852 }
853}
854#[cfg(feature = "full")]
855#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
856impl Clone for ForeignItemFn {
857 fn clone(&self) -> Self {
858 ForeignItemFn {
859 attrs: self.attrs.clone(),
860 vis: self.vis.clone(),
861 sig: self.sig.clone(),
862 semi_token: self.semi_token.clone(),
863 }
864 }
865}
866#[cfg(feature = "full")]
867#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
868impl Clone for ForeignItemMacro {
869 fn clone(&self) -> Self {
870 ForeignItemMacro {
871 attrs: self.attrs.clone(),
872 mac: self.mac.clone(),
873 semi_token: self.semi_token.clone(),
874 }
875 }
876}
877#[cfg(feature = "full")]
878#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
879impl Clone for ForeignItemStatic {
880 fn clone(&self) -> Self {
881 ForeignItemStatic {
882 attrs: self.attrs.clone(),
883 vis: self.vis.clone(),
884 static_token: self.static_token.clone(),
885 mutability: self.mutability.clone(),
886 ident: self.ident.clone(),
887 colon_token: self.colon_token.clone(),
888 ty: self.ty.clone(),
889 semi_token: self.semi_token.clone(),
890 }
891 }
892}
893#[cfg(feature = "full")]
894#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
895impl Clone for ForeignItemType {
896 fn clone(&self) -> Self {
897 ForeignItemType {
898 attrs: self.attrs.clone(),
899 vis: self.vis.clone(),
900 type_token: self.type_token.clone(),
901 ident: self.ident.clone(),
902 semi_token: self.semi_token.clone(),
903 }
904 }
905}
906#[cfg(any(feature = "derive", feature = "full"))]
907#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
908impl Clone for GenericArgument {
909 fn clone(&self) -> Self {
910 match self {
911 GenericArgument::Lifetime(v0: &Lifetime) => GenericArgument::Lifetime(v0.clone()),
912 GenericArgument::Type(v0: &Type) => GenericArgument::Type(v0.clone()),
913 GenericArgument::Const(v0: &Expr) => GenericArgument::Const(v0.clone()),
914 GenericArgument::Binding(v0: &Binding) => GenericArgument::Binding(v0.clone()),
915 GenericArgument::Constraint(v0: &Constraint) => GenericArgument::Constraint(v0.clone()),
916 }
917 }
918}
919#[cfg(feature = "full")]
920#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
921impl Clone for GenericMethodArgument {
922 fn clone(&self) -> Self {
923 match self {
924 GenericMethodArgument::Type(v0: &Type) => GenericMethodArgument::Type(v0.clone()),
925 GenericMethodArgument::Const(v0: &Expr) => GenericMethodArgument::Const(v0.clone()),
926 }
927 }
928}
929#[cfg(any(feature = "derive", feature = "full"))]
930#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
931impl Clone for GenericParam {
932 fn clone(&self) -> Self {
933 match self {
934 GenericParam::Type(v0: &TypeParam) => GenericParam::Type(v0.clone()),
935 GenericParam::Lifetime(v0: &LifetimeDef) => GenericParam::Lifetime(v0.clone()),
936 GenericParam::Const(v0: &ConstParam) => GenericParam::Const(v0.clone()),
937 }
938 }
939}
940#[cfg(any(feature = "derive", feature = "full"))]
941#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
942impl Clone for Generics {
943 fn clone(&self) -> Self {
944 Generics {
945 lt_token: self.lt_token.clone(),
946 params: self.params.clone(),
947 gt_token: self.gt_token.clone(),
948 where_clause: self.where_clause.clone(),
949 }
950 }
951}
952#[cfg(feature = "full")]
953#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
954impl Clone for ImplItem {
955 fn clone(&self) -> Self {
956 match self {
957 ImplItem::Const(v0: &ImplItemConst) => ImplItem::Const(v0.clone()),
958 ImplItem::Method(v0: &ImplItemMethod) => ImplItem::Method(v0.clone()),
959 ImplItem::Type(v0: &ImplItemType) => ImplItem::Type(v0.clone()),
960 ImplItem::Macro(v0: &ImplItemMacro) => ImplItem::Macro(v0.clone()),
961 ImplItem::Verbatim(v0: &TokenStream) => ImplItem::Verbatim(v0.clone()),
962 #[cfg(syn_no_non_exhaustive)]
963 _ => unreachable!(),
964 }
965 }
966}
967#[cfg(feature = "full")]
968#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
969impl Clone for ImplItemConst {
970 fn clone(&self) -> Self {
971 ImplItemConst {
972 attrs: self.attrs.clone(),
973 vis: self.vis.clone(),
974 defaultness: self.defaultness.clone(),
975 const_token: self.const_token.clone(),
976 ident: self.ident.clone(),
977 colon_token: self.colon_token.clone(),
978 ty: self.ty.clone(),
979 eq_token: self.eq_token.clone(),
980 expr: self.expr.clone(),
981 semi_token: self.semi_token.clone(),
982 }
983 }
984}
985#[cfg(feature = "full")]
986#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
987impl Clone for ImplItemMacro {
988 fn clone(&self) -> Self {
989 ImplItemMacro {
990 attrs: self.attrs.clone(),
991 mac: self.mac.clone(),
992 semi_token: self.semi_token.clone(),
993 }
994 }
995}
996#[cfg(feature = "full")]
997#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
998impl Clone for ImplItemMethod {
999 fn clone(&self) -> Self {
1000 ImplItemMethod {
1001 attrs: self.attrs.clone(),
1002 vis: self.vis.clone(),
1003 defaultness: self.defaultness.clone(),
1004 sig: self.sig.clone(),
1005 block: self.block.clone(),
1006 }
1007 }
1008}
1009#[cfg(feature = "full")]
1010#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1011impl Clone for ImplItemType {
1012 fn clone(&self) -> Self {
1013 ImplItemType {
1014 attrs: self.attrs.clone(),
1015 vis: self.vis.clone(),
1016 defaultness: self.defaultness.clone(),
1017 type_token: self.type_token.clone(),
1018 ident: self.ident.clone(),
1019 generics: self.generics.clone(),
1020 eq_token: self.eq_token.clone(),
1021 ty: self.ty.clone(),
1022 semi_token: self.semi_token.clone(),
1023 }
1024 }
1025}
1026#[cfg(any(feature = "derive", feature = "full"))]
1027#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1028impl Clone for Index {
1029 fn clone(&self) -> Self {
1030 Index {
1031 index: self.index.clone(),
1032 span: self.span.clone(),
1033 }
1034 }
1035}
1036#[cfg(feature = "full")]
1037#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1038impl Clone for Item {
1039 fn clone(&self) -> Self {
1040 match self {
1041 Item::Const(v0) => Item::Const(v0.clone()),
1042 Item::Enum(v0) => Item::Enum(v0.clone()),
1043 Item::ExternCrate(v0) => Item::ExternCrate(v0.clone()),
1044 Item::Fn(v0) => Item::Fn(v0.clone()),
1045 Item::ForeignMod(v0) => Item::ForeignMod(v0.clone()),
1046 Item::Impl(v0) => Item::Impl(v0.clone()),
1047 Item::Macro(v0) => Item::Macro(v0.clone()),
1048 Item::Macro2(v0) => Item::Macro2(v0.clone()),
1049 Item::Mod(v0) => Item::Mod(v0.clone()),
1050 Item::Static(v0) => Item::Static(v0.clone()),
1051 Item::Struct(v0) => Item::Struct(v0.clone()),
1052 Item::Trait(v0) => Item::Trait(v0.clone()),
1053 Item::TraitAlias(v0) => Item::TraitAlias(v0.clone()),
1054 Item::Type(v0) => Item::Type(v0.clone()),
1055 Item::Union(v0) => Item::Union(v0.clone()),
1056 Item::Use(v0) => Item::Use(v0.clone()),
1057 Item::Verbatim(v0) => Item::Verbatim(v0.clone()),
1058 #[cfg(syn_no_non_exhaustive)]
1059 _ => unreachable!(),
1060 }
1061 }
1062}
1063#[cfg(feature = "full")]
1064#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1065impl Clone for ItemConst {
1066 fn clone(&self) -> Self {
1067 ItemConst {
1068 attrs: self.attrs.clone(),
1069 vis: self.vis.clone(),
1070 const_token: self.const_token.clone(),
1071 ident: self.ident.clone(),
1072 colon_token: self.colon_token.clone(),
1073 ty: self.ty.clone(),
1074 eq_token: self.eq_token.clone(),
1075 expr: self.expr.clone(),
1076 semi_token: self.semi_token.clone(),
1077 }
1078 }
1079}
1080#[cfg(feature = "full")]
1081#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1082impl Clone for ItemEnum {
1083 fn clone(&self) -> Self {
1084 ItemEnum {
1085 attrs: self.attrs.clone(),
1086 vis: self.vis.clone(),
1087 enum_token: self.enum_token.clone(),
1088 ident: self.ident.clone(),
1089 generics: self.generics.clone(),
1090 brace_token: self.brace_token.clone(),
1091 variants: self.variants.clone(),
1092 }
1093 }
1094}
1095#[cfg(feature = "full")]
1096#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1097impl Clone for ItemExternCrate {
1098 fn clone(&self) -> Self {
1099 ItemExternCrate {
1100 attrs: self.attrs.clone(),
1101 vis: self.vis.clone(),
1102 extern_token: self.extern_token.clone(),
1103 crate_token: self.crate_token.clone(),
1104 ident: self.ident.clone(),
1105 rename: self.rename.clone(),
1106 semi_token: self.semi_token.clone(),
1107 }
1108 }
1109}
1110#[cfg(feature = "full")]
1111#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1112impl Clone for ItemFn {
1113 fn clone(&self) -> Self {
1114 ItemFn {
1115 attrs: self.attrs.clone(),
1116 vis: self.vis.clone(),
1117 sig: self.sig.clone(),
1118 block: self.block.clone(),
1119 }
1120 }
1121}
1122#[cfg(feature = "full")]
1123#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1124impl Clone for ItemForeignMod {
1125 fn clone(&self) -> Self {
1126 ItemForeignMod {
1127 attrs: self.attrs.clone(),
1128 abi: self.abi.clone(),
1129 brace_token: self.brace_token.clone(),
1130 items: self.items.clone(),
1131 }
1132 }
1133}
1134#[cfg(feature = "full")]
1135#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1136impl Clone for ItemImpl {
1137 fn clone(&self) -> Self {
1138 ItemImpl {
1139 attrs: self.attrs.clone(),
1140 defaultness: self.defaultness.clone(),
1141 unsafety: self.unsafety.clone(),
1142 impl_token: self.impl_token.clone(),
1143 generics: self.generics.clone(),
1144 trait_: self.trait_.clone(),
1145 self_ty: self.self_ty.clone(),
1146 brace_token: self.brace_token.clone(),
1147 items: self.items.clone(),
1148 }
1149 }
1150}
1151#[cfg(feature = "full")]
1152#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1153impl Clone for ItemMacro {
1154 fn clone(&self) -> Self {
1155 ItemMacro {
1156 attrs: self.attrs.clone(),
1157 ident: self.ident.clone(),
1158 mac: self.mac.clone(),
1159 semi_token: self.semi_token.clone(),
1160 }
1161 }
1162}
1163#[cfg(feature = "full")]
1164#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1165impl Clone for ItemMacro2 {
1166 fn clone(&self) -> Self {
1167 ItemMacro2 {
1168 attrs: self.attrs.clone(),
1169 vis: self.vis.clone(),
1170 macro_token: self.macro_token.clone(),
1171 ident: self.ident.clone(),
1172 rules: self.rules.clone(),
1173 }
1174 }
1175}
1176#[cfg(feature = "full")]
1177#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1178impl Clone for ItemMod {
1179 fn clone(&self) -> Self {
1180 ItemMod {
1181 attrs: self.attrs.clone(),
1182 vis: self.vis.clone(),
1183 mod_token: self.mod_token.clone(),
1184 ident: self.ident.clone(),
1185 content: self.content.clone(),
1186 semi: self.semi.clone(),
1187 }
1188 }
1189}
1190#[cfg(feature = "full")]
1191#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1192impl Clone for ItemStatic {
1193 fn clone(&self) -> Self {
1194 ItemStatic {
1195 attrs: self.attrs.clone(),
1196 vis: self.vis.clone(),
1197 static_token: self.static_token.clone(),
1198 mutability: self.mutability.clone(),
1199 ident: self.ident.clone(),
1200 colon_token: self.colon_token.clone(),
1201 ty: self.ty.clone(),
1202 eq_token: self.eq_token.clone(),
1203 expr: self.expr.clone(),
1204 semi_token: self.semi_token.clone(),
1205 }
1206 }
1207}
1208#[cfg(feature = "full")]
1209#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1210impl Clone for ItemStruct {
1211 fn clone(&self) -> Self {
1212 ItemStruct {
1213 attrs: self.attrs.clone(),
1214 vis: self.vis.clone(),
1215 struct_token: self.struct_token.clone(),
1216 ident: self.ident.clone(),
1217 generics: self.generics.clone(),
1218 fields: self.fields.clone(),
1219 semi_token: self.semi_token.clone(),
1220 }
1221 }
1222}
1223#[cfg(feature = "full")]
1224#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1225impl Clone for ItemTrait {
1226 fn clone(&self) -> Self {
1227 ItemTrait {
1228 attrs: self.attrs.clone(),
1229 vis: self.vis.clone(),
1230 unsafety: self.unsafety.clone(),
1231 auto_token: self.auto_token.clone(),
1232 trait_token: self.trait_token.clone(),
1233 ident: self.ident.clone(),
1234 generics: self.generics.clone(),
1235 colon_token: self.colon_token.clone(),
1236 supertraits: self.supertraits.clone(),
1237 brace_token: self.brace_token.clone(),
1238 items: self.items.clone(),
1239 }
1240 }
1241}
1242#[cfg(feature = "full")]
1243#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1244impl Clone for ItemTraitAlias {
1245 fn clone(&self) -> Self {
1246 ItemTraitAlias {
1247 attrs: self.attrs.clone(),
1248 vis: self.vis.clone(),
1249 trait_token: self.trait_token.clone(),
1250 ident: self.ident.clone(),
1251 generics: self.generics.clone(),
1252 eq_token: self.eq_token.clone(),
1253 bounds: self.bounds.clone(),
1254 semi_token: self.semi_token.clone(),
1255 }
1256 }
1257}
1258#[cfg(feature = "full")]
1259#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1260impl Clone for ItemType {
1261 fn clone(&self) -> Self {
1262 ItemType {
1263 attrs: self.attrs.clone(),
1264 vis: self.vis.clone(),
1265 type_token: self.type_token.clone(),
1266 ident: self.ident.clone(),
1267 generics: self.generics.clone(),
1268 eq_token: self.eq_token.clone(),
1269 ty: self.ty.clone(),
1270 semi_token: self.semi_token.clone(),
1271 }
1272 }
1273}
1274#[cfg(feature = "full")]
1275#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1276impl Clone for ItemUnion {
1277 fn clone(&self) -> Self {
1278 ItemUnion {
1279 attrs: self.attrs.clone(),
1280 vis: self.vis.clone(),
1281 union_token: self.union_token.clone(),
1282 ident: self.ident.clone(),
1283 generics: self.generics.clone(),
1284 fields: self.fields.clone(),
1285 }
1286 }
1287}
1288#[cfg(feature = "full")]
1289#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1290impl Clone for ItemUse {
1291 fn clone(&self) -> Self {
1292 ItemUse {
1293 attrs: self.attrs.clone(),
1294 vis: self.vis.clone(),
1295 use_token: self.use_token.clone(),
1296 leading_colon: self.leading_colon.clone(),
1297 tree: self.tree.clone(),
1298 semi_token: self.semi_token.clone(),
1299 }
1300 }
1301}
1302#[cfg(feature = "full")]
1303#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1304impl Clone for Label {
1305 fn clone(&self) -> Self {
1306 Label {
1307 name: self.name.clone(),
1308 colon_token: self.colon_token.clone(),
1309 }
1310 }
1311}
1312#[cfg(any(feature = "derive", feature = "full"))]
1313#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1314impl Clone for LifetimeDef {
1315 fn clone(&self) -> Self {
1316 LifetimeDef {
1317 attrs: self.attrs.clone(),
1318 lifetime: self.lifetime.clone(),
1319 colon_token: self.colon_token.clone(),
1320 bounds: self.bounds.clone(),
1321 }
1322 }
1323}
1324#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1325impl Clone for Lit {
1326 fn clone(&self) -> Self {
1327 match self {
1328 Lit::Str(v0: &LitStr) => Lit::Str(v0.clone()),
1329 Lit::ByteStr(v0: &LitByteStr) => Lit::ByteStr(v0.clone()),
1330 Lit::Byte(v0: &LitByte) => Lit::Byte(v0.clone()),
1331 Lit::Char(v0: &LitChar) => Lit::Char(v0.clone()),
1332 Lit::Int(v0: &LitInt) => Lit::Int(v0.clone()),
1333 Lit::Float(v0: &LitFloat) => Lit::Float(v0.clone()),
1334 Lit::Bool(v0: &LitBool) => Lit::Bool(v0.clone()),
1335 Lit::Verbatim(v0: &Literal) => Lit::Verbatim(v0.clone()),
1336 }
1337 }
1338}
1339#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1340impl Clone for LitBool {
1341 fn clone(&self) -> Self {
1342 LitBool {
1343 value: self.value.clone(),
1344 span: self.span.clone(),
1345 }
1346 }
1347}
1348#[cfg(feature = "full")]
1349#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1350impl Clone for Local {
1351 fn clone(&self) -> Self {
1352 Local {
1353 attrs: self.attrs.clone(),
1354 let_token: self.let_token.clone(),
1355 pat: self.pat.clone(),
1356 init: self.init.clone(),
1357 semi_token: self.semi_token.clone(),
1358 }
1359 }
1360}
1361#[cfg(any(feature = "derive", feature = "full"))]
1362#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1363impl Clone for Macro {
1364 fn clone(&self) -> Self {
1365 Macro {
1366 path: self.path.clone(),
1367 bang_token: self.bang_token.clone(),
1368 delimiter: self.delimiter.clone(),
1369 tokens: self.tokens.clone(),
1370 }
1371 }
1372}
1373#[cfg(any(feature = "derive", feature = "full"))]
1374#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1375impl Clone for MacroDelimiter {
1376 fn clone(&self) -> Self {
1377 match self {
1378 MacroDelimiter::Paren(v0: &Paren) => MacroDelimiter::Paren(v0.clone()),
1379 MacroDelimiter::Brace(v0: &Brace) => MacroDelimiter::Brace(v0.clone()),
1380 MacroDelimiter::Bracket(v0: &Bracket) => MacroDelimiter::Bracket(v0.clone()),
1381 }
1382 }
1383}
1384#[cfg(any(feature = "derive", feature = "full"))]
1385#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1386impl Clone for Member {
1387 fn clone(&self) -> Self {
1388 match self {
1389 Member::Named(v0: &Ident) => Member::Named(v0.clone()),
1390 Member::Unnamed(v0: &Index) => Member::Unnamed(v0.clone()),
1391 }
1392 }
1393}
1394#[cfg(any(feature = "derive", feature = "full"))]
1395#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1396impl Clone for Meta {
1397 fn clone(&self) -> Self {
1398 match self {
1399 Meta::Path(v0: &Path) => Meta::Path(v0.clone()),
1400 Meta::List(v0: &MetaList) => Meta::List(v0.clone()),
1401 Meta::NameValue(v0: &MetaNameValue) => Meta::NameValue(v0.clone()),
1402 }
1403 }
1404}
1405#[cfg(any(feature = "derive", feature = "full"))]
1406#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1407impl Clone for MetaList {
1408 fn clone(&self) -> Self {
1409 MetaList {
1410 path: self.path.clone(),
1411 paren_token: self.paren_token.clone(),
1412 nested: self.nested.clone(),
1413 }
1414 }
1415}
1416#[cfg(any(feature = "derive", feature = "full"))]
1417#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1418impl Clone for MetaNameValue {
1419 fn clone(&self) -> Self {
1420 MetaNameValue {
1421 path: self.path.clone(),
1422 eq_token: self.eq_token.clone(),
1423 lit: self.lit.clone(),
1424 }
1425 }
1426}
1427#[cfg(feature = "full")]
1428#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1429impl Clone for MethodTurbofish {
1430 fn clone(&self) -> Self {
1431 MethodTurbofish {
1432 colon2_token: self.colon2_token.clone(),
1433 lt_token: self.lt_token.clone(),
1434 args: self.args.clone(),
1435 gt_token: self.gt_token.clone(),
1436 }
1437 }
1438}
1439#[cfg(any(feature = "derive", feature = "full"))]
1440#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1441impl Clone for NestedMeta {
1442 fn clone(&self) -> Self {
1443 match self {
1444 NestedMeta::Meta(v0: &Meta) => NestedMeta::Meta(v0.clone()),
1445 NestedMeta::Lit(v0: &Lit) => NestedMeta::Lit(v0.clone()),
1446 }
1447 }
1448}
1449#[cfg(any(feature = "derive", feature = "full"))]
1450#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1451impl Clone for ParenthesizedGenericArguments {
1452 fn clone(&self) -> Self {
1453 ParenthesizedGenericArguments {
1454 paren_token: self.paren_token.clone(),
1455 inputs: self.inputs.clone(),
1456 output: self.output.clone(),
1457 }
1458 }
1459}
1460#[cfg(feature = "full")]
1461#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1462impl Clone for Pat {
1463 fn clone(&self) -> Self {
1464 match self {
1465 Pat::Box(v0: &PatBox) => Pat::Box(v0.clone()),
1466 Pat::Ident(v0: &PatIdent) => Pat::Ident(v0.clone()),
1467 Pat::Lit(v0: &PatLit) => Pat::Lit(v0.clone()),
1468 Pat::Macro(v0: &PatMacro) => Pat::Macro(v0.clone()),
1469 Pat::Or(v0: &PatOr) => Pat::Or(v0.clone()),
1470 Pat::Path(v0: &PatPath) => Pat::Path(v0.clone()),
1471 Pat::Range(v0: &PatRange) => Pat::Range(v0.clone()),
1472 Pat::Reference(v0: &PatReference) => Pat::Reference(v0.clone()),
1473 Pat::Rest(v0: &PatRest) => Pat::Rest(v0.clone()),
1474 Pat::Slice(v0: &PatSlice) => Pat::Slice(v0.clone()),
1475 Pat::Struct(v0: &PatStruct) => Pat::Struct(v0.clone()),
1476 Pat::Tuple(v0: &PatTuple) => Pat::Tuple(v0.clone()),
1477 Pat::TupleStruct(v0: &PatTupleStruct) => Pat::TupleStruct(v0.clone()),
1478 Pat::Type(v0: &PatType) => Pat::Type(v0.clone()),
1479 Pat::Verbatim(v0: &TokenStream) => Pat::Verbatim(v0.clone()),
1480 Pat::Wild(v0: &PatWild) => Pat::Wild(v0.clone()),
1481 #[cfg(syn_no_non_exhaustive)]
1482 _ => unreachable!(),
1483 }
1484 }
1485}
1486#[cfg(feature = "full")]
1487#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1488impl Clone for PatBox {
1489 fn clone(&self) -> Self {
1490 PatBox {
1491 attrs: self.attrs.clone(),
1492 box_token: self.box_token.clone(),
1493 pat: self.pat.clone(),
1494 }
1495 }
1496}
1497#[cfg(feature = "full")]
1498#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1499impl Clone for PatIdent {
1500 fn clone(&self) -> Self {
1501 PatIdent {
1502 attrs: self.attrs.clone(),
1503 by_ref: self.by_ref.clone(),
1504 mutability: self.mutability.clone(),
1505 ident: self.ident.clone(),
1506 subpat: self.subpat.clone(),
1507 }
1508 }
1509}
1510#[cfg(feature = "full")]
1511#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1512impl Clone for PatLit {
1513 fn clone(&self) -> Self {
1514 PatLit {
1515 attrs: self.attrs.clone(),
1516 expr: self.expr.clone(),
1517 }
1518 }
1519}
1520#[cfg(feature = "full")]
1521#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1522impl Clone for PatMacro {
1523 fn clone(&self) -> Self {
1524 PatMacro {
1525 attrs: self.attrs.clone(),
1526 mac: self.mac.clone(),
1527 }
1528 }
1529}
1530#[cfg(feature = "full")]
1531#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1532impl Clone for PatOr {
1533 fn clone(&self) -> Self {
1534 PatOr {
1535 attrs: self.attrs.clone(),
1536 leading_vert: self.leading_vert.clone(),
1537 cases: self.cases.clone(),
1538 }
1539 }
1540}
1541#[cfg(feature = "full")]
1542#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1543impl Clone for PatPath {
1544 fn clone(&self) -> Self {
1545 PatPath {
1546 attrs: self.attrs.clone(),
1547 qself: self.qself.clone(),
1548 path: self.path.clone(),
1549 }
1550 }
1551}
1552#[cfg(feature = "full")]
1553#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1554impl Clone for PatRange {
1555 fn clone(&self) -> Self {
1556 PatRange {
1557 attrs: self.attrs.clone(),
1558 lo: self.lo.clone(),
1559 limits: self.limits.clone(),
1560 hi: self.hi.clone(),
1561 }
1562 }
1563}
1564#[cfg(feature = "full")]
1565#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1566impl Clone for PatReference {
1567 fn clone(&self) -> Self {
1568 PatReference {
1569 attrs: self.attrs.clone(),
1570 and_token: self.and_token.clone(),
1571 mutability: self.mutability.clone(),
1572 pat: self.pat.clone(),
1573 }
1574 }
1575}
1576#[cfg(feature = "full")]
1577#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1578impl Clone for PatRest {
1579 fn clone(&self) -> Self {
1580 PatRest {
1581 attrs: self.attrs.clone(),
1582 dot2_token: self.dot2_token.clone(),
1583 }
1584 }
1585}
1586#[cfg(feature = "full")]
1587#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1588impl Clone for PatSlice {
1589 fn clone(&self) -> Self {
1590 PatSlice {
1591 attrs: self.attrs.clone(),
1592 bracket_token: self.bracket_token.clone(),
1593 elems: self.elems.clone(),
1594 }
1595 }
1596}
1597#[cfg(feature = "full")]
1598#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1599impl Clone for PatStruct {
1600 fn clone(&self) -> Self {
1601 PatStruct {
1602 attrs: self.attrs.clone(),
1603 path: self.path.clone(),
1604 brace_token: self.brace_token.clone(),
1605 fields: self.fields.clone(),
1606 dot2_token: self.dot2_token.clone(),
1607 }
1608 }
1609}
1610#[cfg(feature = "full")]
1611#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1612impl Clone for PatTuple {
1613 fn clone(&self) -> Self {
1614 PatTuple {
1615 attrs: self.attrs.clone(),
1616 paren_token: self.paren_token.clone(),
1617 elems: self.elems.clone(),
1618 }
1619 }
1620}
1621#[cfg(feature = "full")]
1622#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1623impl Clone for PatTupleStruct {
1624 fn clone(&self) -> Self {
1625 PatTupleStruct {
1626 attrs: self.attrs.clone(),
1627 path: self.path.clone(),
1628 pat: self.pat.clone(),
1629 }
1630 }
1631}
1632#[cfg(feature = "full")]
1633#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1634impl Clone for PatType {
1635 fn clone(&self) -> Self {
1636 PatType {
1637 attrs: self.attrs.clone(),
1638 pat: self.pat.clone(),
1639 colon_token: self.colon_token.clone(),
1640 ty: self.ty.clone(),
1641 }
1642 }
1643}
1644#[cfg(feature = "full")]
1645#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1646impl Clone for PatWild {
1647 fn clone(&self) -> Self {
1648 PatWild {
1649 attrs: self.attrs.clone(),
1650 underscore_token: self.underscore_token.clone(),
1651 }
1652 }
1653}
1654#[cfg(any(feature = "derive", feature = "full"))]
1655#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1656impl Clone for Path {
1657 fn clone(&self) -> Self {
1658 Path {
1659 leading_colon: self.leading_colon.clone(),
1660 segments: self.segments.clone(),
1661 }
1662 }
1663}
1664#[cfg(any(feature = "derive", feature = "full"))]
1665#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1666impl Clone for PathArguments {
1667 fn clone(&self) -> Self {
1668 match self {
1669 PathArguments::None => PathArguments::None,
1670 PathArguments::AngleBracketed(v0: &AngleBracketedGenericArguments) => {
1671 PathArguments::AngleBracketed(v0.clone())
1672 }
1673 PathArguments::Parenthesized(v0: &ParenthesizedGenericArguments) => PathArguments::Parenthesized(v0.clone()),
1674 }
1675 }
1676}
1677#[cfg(any(feature = "derive", feature = "full"))]
1678#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1679impl Clone for PathSegment {
1680 fn clone(&self) -> Self {
1681 PathSegment {
1682 ident: self.ident.clone(),
1683 arguments: self.arguments.clone(),
1684 }
1685 }
1686}
1687#[cfg(any(feature = "derive", feature = "full"))]
1688#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1689impl Clone for PredicateEq {
1690 fn clone(&self) -> Self {
1691 PredicateEq {
1692 lhs_ty: self.lhs_ty.clone(),
1693 eq_token: self.eq_token.clone(),
1694 rhs_ty: self.rhs_ty.clone(),
1695 }
1696 }
1697}
1698#[cfg(any(feature = "derive", feature = "full"))]
1699#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1700impl Clone for PredicateLifetime {
1701 fn clone(&self) -> Self {
1702 PredicateLifetime {
1703 lifetime: self.lifetime.clone(),
1704 colon_token: self.colon_token.clone(),
1705 bounds: self.bounds.clone(),
1706 }
1707 }
1708}
1709#[cfg(any(feature = "derive", feature = "full"))]
1710#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1711impl Clone for PredicateType {
1712 fn clone(&self) -> Self {
1713 PredicateType {
1714 lifetimes: self.lifetimes.clone(),
1715 bounded_ty: self.bounded_ty.clone(),
1716 colon_token: self.colon_token.clone(),
1717 bounds: self.bounds.clone(),
1718 }
1719 }
1720}
1721#[cfg(any(feature = "derive", feature = "full"))]
1722#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1723impl Clone for QSelf {
1724 fn clone(&self) -> Self {
1725 QSelf {
1726 lt_token: self.lt_token.clone(),
1727 ty: self.ty.clone(),
1728 position: self.position.clone(),
1729 as_token: self.as_token.clone(),
1730 gt_token: self.gt_token.clone(),
1731 }
1732 }
1733}
1734#[cfg(feature = "full")]
1735#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1736impl Copy for RangeLimits {}
1737#[cfg(feature = "full")]
1738#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1739impl Clone for RangeLimits {
1740 fn clone(&self) -> Self {
1741 *self
1742 }
1743}
1744#[cfg(feature = "full")]
1745#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1746impl Clone for Receiver {
1747 fn clone(&self) -> Self {
1748 Receiver {
1749 attrs: self.attrs.clone(),
1750 reference: self.reference.clone(),
1751 mutability: self.mutability.clone(),
1752 self_token: self.self_token.clone(),
1753 }
1754 }
1755}
1756#[cfg(any(feature = "derive", feature = "full"))]
1757#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1758impl Clone for ReturnType {
1759 fn clone(&self) -> Self {
1760 match self {
1761 ReturnType::Default => ReturnType::Default,
1762 ReturnType::Type(v0: &RArrow, v1: &Box) => ReturnType::Type(v0.clone(), v1.clone()),
1763 }
1764 }
1765}
1766#[cfg(feature = "full")]
1767#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1768impl Clone for Signature {
1769 fn clone(&self) -> Self {
1770 Signature {
1771 constness: self.constness.clone(),
1772 asyncness: self.asyncness.clone(),
1773 unsafety: self.unsafety.clone(),
1774 abi: self.abi.clone(),
1775 fn_token: self.fn_token.clone(),
1776 ident: self.ident.clone(),
1777 generics: self.generics.clone(),
1778 paren_token: self.paren_token.clone(),
1779 inputs: self.inputs.clone(),
1780 variadic: self.variadic.clone(),
1781 output: self.output.clone(),
1782 }
1783 }
1784}
1785#[cfg(feature = "full")]
1786#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1787impl Clone for Stmt {
1788 fn clone(&self) -> Self {
1789 match self {
1790 Stmt::Local(v0: &Local) => Stmt::Local(v0.clone()),
1791 Stmt::Item(v0: &Item) => Stmt::Item(v0.clone()),
1792 Stmt::Expr(v0: &Expr) => Stmt::Expr(v0.clone()),
1793 Stmt::Semi(v0: &Expr, v1: &Semi) => Stmt::Semi(v0.clone(), v1.clone()),
1794 }
1795 }
1796}
1797#[cfg(any(feature = "derive", feature = "full"))]
1798#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1799impl Clone for TraitBound {
1800 fn clone(&self) -> Self {
1801 TraitBound {
1802 paren_token: self.paren_token.clone(),
1803 modifier: self.modifier.clone(),
1804 lifetimes: self.lifetimes.clone(),
1805 path: self.path.clone(),
1806 }
1807 }
1808}
1809#[cfg(any(feature = "derive", feature = "full"))]
1810#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1811impl Copy for TraitBoundModifier {}
1812#[cfg(any(feature = "derive", feature = "full"))]
1813#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1814impl Clone for TraitBoundModifier {
1815 fn clone(&self) -> Self {
1816 *self
1817 }
1818}
1819#[cfg(feature = "full")]
1820#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1821impl Clone for TraitItem {
1822 fn clone(&self) -> Self {
1823 match self {
1824 TraitItem::Const(v0: &TraitItemConst) => TraitItem::Const(v0.clone()),
1825 TraitItem::Method(v0: &TraitItemMethod) => TraitItem::Method(v0.clone()),
1826 TraitItem::Type(v0: &TraitItemType) => TraitItem::Type(v0.clone()),
1827 TraitItem::Macro(v0: &TraitItemMacro) => TraitItem::Macro(v0.clone()),
1828 TraitItem::Verbatim(v0: &TokenStream) => TraitItem::Verbatim(v0.clone()),
1829 #[cfg(syn_no_non_exhaustive)]
1830 _ => unreachable!(),
1831 }
1832 }
1833}
1834#[cfg(feature = "full")]
1835#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1836impl Clone for TraitItemConst {
1837 fn clone(&self) -> Self {
1838 TraitItemConst {
1839 attrs: self.attrs.clone(),
1840 const_token: self.const_token.clone(),
1841 ident: self.ident.clone(),
1842 colon_token: self.colon_token.clone(),
1843 ty: self.ty.clone(),
1844 default: self.default.clone(),
1845 semi_token: self.semi_token.clone(),
1846 }
1847 }
1848}
1849#[cfg(feature = "full")]
1850#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1851impl Clone for TraitItemMacro {
1852 fn clone(&self) -> Self {
1853 TraitItemMacro {
1854 attrs: self.attrs.clone(),
1855 mac: self.mac.clone(),
1856 semi_token: self.semi_token.clone(),
1857 }
1858 }
1859}
1860#[cfg(feature = "full")]
1861#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1862impl Clone for TraitItemMethod {
1863 fn clone(&self) -> Self {
1864 TraitItemMethod {
1865 attrs: self.attrs.clone(),
1866 sig: self.sig.clone(),
1867 default: self.default.clone(),
1868 semi_token: self.semi_token.clone(),
1869 }
1870 }
1871}
1872#[cfg(feature = "full")]
1873#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1874impl Clone for TraitItemType {
1875 fn clone(&self) -> Self {
1876 TraitItemType {
1877 attrs: self.attrs.clone(),
1878 type_token: self.type_token.clone(),
1879 ident: self.ident.clone(),
1880 generics: self.generics.clone(),
1881 colon_token: self.colon_token.clone(),
1882 bounds: self.bounds.clone(),
1883 default: self.default.clone(),
1884 semi_token: self.semi_token.clone(),
1885 }
1886 }
1887}
1888#[cfg(any(feature = "derive", feature = "full"))]
1889#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1890impl Clone for Type {
1891 fn clone(&self) -> Self {
1892 match self {
1893 Type::Array(v0: &TypeArray) => Type::Array(v0.clone()),
1894 Type::BareFn(v0: &TypeBareFn) => Type::BareFn(v0.clone()),
1895 Type::Group(v0: &TypeGroup) => Type::Group(v0.clone()),
1896 Type::ImplTrait(v0: &TypeImplTrait) => Type::ImplTrait(v0.clone()),
1897 Type::Infer(v0: &TypeInfer) => Type::Infer(v0.clone()),
1898 Type::Macro(v0: &TypeMacro) => Type::Macro(v0.clone()),
1899 Type::Never(v0: &TypeNever) => Type::Never(v0.clone()),
1900 Type::Paren(v0: &TypeParen) => Type::Paren(v0.clone()),
1901 Type::Path(v0: &TypePath) => Type::Path(v0.clone()),
1902 Type::Ptr(v0: &TypePtr) => Type::Ptr(v0.clone()),
1903 Type::Reference(v0: &TypeReference) => Type::Reference(v0.clone()),
1904 Type::Slice(v0: &TypeSlice) => Type::Slice(v0.clone()),
1905 Type::TraitObject(v0: &TypeTraitObject) => Type::TraitObject(v0.clone()),
1906 Type::Tuple(v0: &TypeTuple) => Type::Tuple(v0.clone()),
1907 Type::Verbatim(v0: &TokenStream) => Type::Verbatim(v0.clone()),
1908 #[cfg(syn_no_non_exhaustive)]
1909 _ => unreachable!(),
1910 }
1911 }
1912}
1913#[cfg(any(feature = "derive", feature = "full"))]
1914#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1915impl Clone for TypeArray {
1916 fn clone(&self) -> Self {
1917 TypeArray {
1918 bracket_token: self.bracket_token.clone(),
1919 elem: self.elem.clone(),
1920 semi_token: self.semi_token.clone(),
1921 len: self.len.clone(),
1922 }
1923 }
1924}
1925#[cfg(any(feature = "derive", feature = "full"))]
1926#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1927impl Clone for TypeBareFn {
1928 fn clone(&self) -> Self {
1929 TypeBareFn {
1930 lifetimes: self.lifetimes.clone(),
1931 unsafety: self.unsafety.clone(),
1932 abi: self.abi.clone(),
1933 fn_token: self.fn_token.clone(),
1934 paren_token: self.paren_token.clone(),
1935 inputs: self.inputs.clone(),
1936 variadic: self.variadic.clone(),
1937 output: self.output.clone(),
1938 }
1939 }
1940}
1941#[cfg(any(feature = "derive", feature = "full"))]
1942#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1943impl Clone for TypeGroup {
1944 fn clone(&self) -> Self {
1945 TypeGroup {
1946 group_token: self.group_token.clone(),
1947 elem: self.elem.clone(),
1948 }
1949 }
1950}
1951#[cfg(any(feature = "derive", feature = "full"))]
1952#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1953impl Clone for TypeImplTrait {
1954 fn clone(&self) -> Self {
1955 TypeImplTrait {
1956 impl_token: self.impl_token.clone(),
1957 bounds: self.bounds.clone(),
1958 }
1959 }
1960}
1961#[cfg(any(feature = "derive", feature = "full"))]
1962#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1963impl Clone for TypeInfer {
1964 fn clone(&self) -> Self {
1965 TypeInfer {
1966 underscore_token: self.underscore_token.clone(),
1967 }
1968 }
1969}
1970#[cfg(any(feature = "derive", feature = "full"))]
1971#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1972impl Clone for TypeMacro {
1973 fn clone(&self) -> Self {
1974 TypeMacro { mac: self.mac.clone() }
1975 }
1976}
1977#[cfg(any(feature = "derive", feature = "full"))]
1978#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1979impl Clone for TypeNever {
1980 fn clone(&self) -> Self {
1981 TypeNever {
1982 bang_token: self.bang_token.clone(),
1983 }
1984 }
1985}
1986#[cfg(any(feature = "derive", feature = "full"))]
1987#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
1988impl Clone for TypeParam {
1989 fn clone(&self) -> Self {
1990 TypeParam {
1991 attrs: self.attrs.clone(),
1992 ident: self.ident.clone(),
1993 colon_token: self.colon_token.clone(),
1994 bounds: self.bounds.clone(),
1995 eq_token: self.eq_token.clone(),
1996 default: self.default.clone(),
1997 }
1998 }
1999}
2000#[cfg(any(feature = "derive", feature = "full"))]
2001#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2002impl Clone for TypeParamBound {
2003 fn clone(&self) -> Self {
2004 match self {
2005 TypeParamBound::Trait(v0: &TraitBound) => TypeParamBound::Trait(v0.clone()),
2006 TypeParamBound::Lifetime(v0: &Lifetime) => TypeParamBound::Lifetime(v0.clone()),
2007 }
2008 }
2009}
2010#[cfg(any(feature = "derive", feature = "full"))]
2011#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2012impl Clone for TypeParen {
2013 fn clone(&self) -> Self {
2014 TypeParen {
2015 paren_token: self.paren_token.clone(),
2016 elem: self.elem.clone(),
2017 }
2018 }
2019}
2020#[cfg(any(feature = "derive", feature = "full"))]
2021#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2022impl Clone for TypePath {
2023 fn clone(&self) -> Self {
2024 TypePath {
2025 qself: self.qself.clone(),
2026 path: self.path.clone(),
2027 }
2028 }
2029}
2030#[cfg(any(feature = "derive", feature = "full"))]
2031#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2032impl Clone for TypePtr {
2033 fn clone(&self) -> Self {
2034 TypePtr {
2035 star_token: self.star_token.clone(),
2036 const_token: self.const_token.clone(),
2037 mutability: self.mutability.clone(),
2038 elem: self.elem.clone(),
2039 }
2040 }
2041}
2042#[cfg(any(feature = "derive", feature = "full"))]
2043#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2044impl Clone for TypeReference {
2045 fn clone(&self) -> Self {
2046 TypeReference {
2047 and_token: self.and_token.clone(),
2048 lifetime: self.lifetime.clone(),
2049 mutability: self.mutability.clone(),
2050 elem: self.elem.clone(),
2051 }
2052 }
2053}
2054#[cfg(any(feature = "derive", feature = "full"))]
2055#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2056impl Clone for TypeSlice {
2057 fn clone(&self) -> Self {
2058 TypeSlice {
2059 bracket_token: self.bracket_token.clone(),
2060 elem: self.elem.clone(),
2061 }
2062 }
2063}
2064#[cfg(any(feature = "derive", feature = "full"))]
2065#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2066impl Clone for TypeTraitObject {
2067 fn clone(&self) -> Self {
2068 TypeTraitObject {
2069 dyn_token: self.dyn_token.clone(),
2070 bounds: self.bounds.clone(),
2071 }
2072 }
2073}
2074#[cfg(any(feature = "derive", feature = "full"))]
2075#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2076impl Clone for TypeTuple {
2077 fn clone(&self) -> Self {
2078 TypeTuple {
2079 paren_token: self.paren_token.clone(),
2080 elems: self.elems.clone(),
2081 }
2082 }
2083}
2084#[cfg(any(feature = "derive", feature = "full"))]
2085#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2086impl Copy for UnOp {}
2087#[cfg(any(feature = "derive", feature = "full"))]
2088#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2089impl Clone for UnOp {
2090 fn clone(&self) -> Self {
2091 *self
2092 }
2093}
2094#[cfg(feature = "full")]
2095#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2096impl Clone for UseGlob {
2097 fn clone(&self) -> Self {
2098 UseGlob {
2099 star_token: self.star_token.clone(),
2100 }
2101 }
2102}
2103#[cfg(feature = "full")]
2104#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2105impl Clone for UseGroup {
2106 fn clone(&self) -> Self {
2107 UseGroup {
2108 brace_token: self.brace_token.clone(),
2109 items: self.items.clone(),
2110 }
2111 }
2112}
2113#[cfg(feature = "full")]
2114#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2115impl Clone for UseName {
2116 fn clone(&self) -> Self {
2117 UseName {
2118 ident: self.ident.clone(),
2119 }
2120 }
2121}
2122#[cfg(feature = "full")]
2123#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2124impl Clone for UsePath {
2125 fn clone(&self) -> Self {
2126 UsePath {
2127 ident: self.ident.clone(),
2128 colon2_token: self.colon2_token.clone(),
2129 tree: self.tree.clone(),
2130 }
2131 }
2132}
2133#[cfg(feature = "full")]
2134#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2135impl Clone for UseRename {
2136 fn clone(&self) -> Self {
2137 UseRename {
2138 ident: self.ident.clone(),
2139 as_token: self.as_token.clone(),
2140 rename: self.rename.clone(),
2141 }
2142 }
2143}
2144#[cfg(feature = "full")]
2145#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2146impl Clone for UseTree {
2147 fn clone(&self) -> Self {
2148 match self {
2149 UseTree::Path(v0: &UsePath) => UseTree::Path(v0.clone()),
2150 UseTree::Name(v0: &UseName) => UseTree::Name(v0.clone()),
2151 UseTree::Rename(v0: &UseRename) => UseTree::Rename(v0.clone()),
2152 UseTree::Glob(v0: &UseGlob) => UseTree::Glob(v0.clone()),
2153 UseTree::Group(v0: &UseGroup) => UseTree::Group(v0.clone()),
2154 }
2155 }
2156}
2157#[cfg(any(feature = "derive", feature = "full"))]
2158#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2159impl Clone for Variadic {
2160 fn clone(&self) -> Self {
2161 Variadic {
2162 attrs: self.attrs.clone(),
2163 dots: self.dots.clone(),
2164 }
2165 }
2166}
2167#[cfg(any(feature = "derive", feature = "full"))]
2168#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2169impl Clone for Variant {
2170 fn clone(&self) -> Self {
2171 Variant {
2172 attrs: self.attrs.clone(),
2173 ident: self.ident.clone(),
2174 fields: self.fields.clone(),
2175 discriminant: self.discriminant.clone(),
2176 }
2177 }
2178}
2179#[cfg(any(feature = "derive", feature = "full"))]
2180#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2181impl Clone for VisCrate {
2182 fn clone(&self) -> Self {
2183 VisCrate {
2184 crate_token: self.crate_token.clone(),
2185 }
2186 }
2187}
2188#[cfg(any(feature = "derive", feature = "full"))]
2189#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2190impl Clone for VisPublic {
2191 fn clone(&self) -> Self {
2192 VisPublic {
2193 pub_token: self.pub_token.clone(),
2194 }
2195 }
2196}
2197#[cfg(any(feature = "derive", feature = "full"))]
2198#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2199impl Clone for VisRestricted {
2200 fn clone(&self) -> Self {
2201 VisRestricted {
2202 pub_token: self.pub_token.clone(),
2203 paren_token: self.paren_token.clone(),
2204 in_token: self.in_token.clone(),
2205 path: self.path.clone(),
2206 }
2207 }
2208}
2209#[cfg(any(feature = "derive", feature = "full"))]
2210#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2211impl Clone for Visibility {
2212 fn clone(&self) -> Self {
2213 match self {
2214 Visibility::Public(v0: &VisPublic) => Visibility::Public(v0.clone()),
2215 Visibility::Crate(v0: &VisCrate) => Visibility::Crate(v0.clone()),
2216 Visibility::Restricted(v0: &VisRestricted) => Visibility::Restricted(v0.clone()),
2217 Visibility::Inherited => Visibility::Inherited,
2218 }
2219 }
2220}
2221#[cfg(any(feature = "derive", feature = "full"))]
2222#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2223impl Clone for WhereClause {
2224 fn clone(&self) -> Self {
2225 WhereClause {
2226 where_token: self.where_token.clone(),
2227 predicates: self.predicates.clone(),
2228 }
2229 }
2230}
2231#[cfg(any(feature = "derive", feature = "full"))]
2232#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
2233impl Clone for WherePredicate {
2234 fn clone(&self) -> Self {
2235 match self {
2236 WherePredicate::Type(v0: &PredicateType) => WherePredicate::Type(v0.clone()),
2237 WherePredicate::Lifetime(v0: &PredicateLifetime) => WherePredicate::Lifetime(v0.clone()),
2238 WherePredicate::Eq(v0: &PredicateEq) => WherePredicate::Eq(v0.clone()),
2239 }
2240 }
2241}
2242