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