1 #![feature(prelude_import)]
3 // compile-flags: -Zunpretty=expanded
6 // This test checks the code generated for all[*] the builtin derivable traits
7 // on a variety of structs and enums. It protects against accidental changes to
8 // the generated code, and makes deliberate changes to the generated code
11 // [*] It excludes `Copy` in some cases, because that changes the code
12 // generated for `Clone`.
14 // [*] It excludes `RustcEncodable` and `RustDecodable`, which are obsolete and
15 // also require the `rustc_serialize` crate.
17 #![crate_type = "lib"]
21 use std::prelude::rust_2021::*;
27 #[automatically_derived]
28 impl ::core::clone::Clone for Empty {
30 fn clone(&self) -> Empty { *self }
32 #[automatically_derived]
33 impl ::core::marker::Copy for Empty { }
34 #[automatically_derived]
35 impl ::core::fmt::Debug for Empty {
36 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
37 ::core::fmt::Formatter::write_str(f, "Empty")
40 #[automatically_derived]
41 impl ::core::default::Default for Empty {
43 fn default() -> Empty { Empty {} }
45 #[automatically_derived]
46 impl ::core::hash::Hash for Empty {
47 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
49 #[automatically_derived]
50 impl ::core::marker::StructuralPartialEq for Empty { }
51 #[automatically_derived]
52 impl ::core::cmp::PartialEq for Empty {
54 fn eq(&self, other: &Empty) -> bool { true }
56 #[automatically_derived]
57 impl ::core::marker::StructuralEq for Empty { }
58 #[automatically_derived]
59 impl ::core::cmp::Eq for Empty {
63 fn assert_receiver_is_total_eq(&self) -> () {}
65 #[automatically_derived]
66 impl ::core::cmp::PartialOrd for Empty {
68 fn partial_cmp(&self, other: &Empty)
69 -> ::core::option::Option<::core::cmp::Ordering> {
70 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
73 #[automatically_derived]
74 impl ::core::cmp::Ord for Empty {
76 fn cmp(&self, other: &Empty) -> ::core::cmp::Ordering {
77 ::core::cmp::Ordering::Equal
81 // A basic struct. Note: because this derives `Copy`, it gets the simple
82 // `clone` implemention that just does `*self`.
87 #[automatically_derived]
88 impl ::core::clone::Clone for Point {
90 fn clone(&self) -> Point {
91 let _: ::core::clone::AssertParamIsClone<u32>;
95 #[automatically_derived]
96 impl ::core::marker::Copy for Point { }
97 #[automatically_derived]
98 impl ::core::fmt::Debug for Point {
99 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
100 ::core::fmt::Formatter::debug_struct_field2_finish(f, "Point", "x",
101 &&self.x, "y", &&self.y)
104 #[automatically_derived]
105 impl ::core::default::Default for Point {
107 fn default() -> Point {
109 x: ::core::default::Default::default(),
110 y: ::core::default::Default::default(),
114 #[automatically_derived]
115 impl ::core::hash::Hash for Point {
116 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
117 ::core::hash::Hash::hash(&self.x, state);
118 ::core::hash::Hash::hash(&self.y, state)
121 #[automatically_derived]
122 impl ::core::marker::StructuralPartialEq for Point { }
123 #[automatically_derived]
124 impl ::core::cmp::PartialEq for Point {
126 fn eq(&self, other: &Point) -> bool {
127 self.x == other.x && self.y == other.y
130 #[automatically_derived]
131 impl ::core::marker::StructuralEq for Point { }
132 #[automatically_derived]
133 impl ::core::cmp::Eq for Point {
137 fn assert_receiver_is_total_eq(&self) -> () {
138 let _: ::core::cmp::AssertParamIsEq<u32>;
141 #[automatically_derived]
142 impl ::core::cmp::PartialOrd for Point {
144 fn partial_cmp(&self, other: &Point)
145 -> ::core::option::Option<::core::cmp::Ordering> {
146 match ::core::cmp::PartialOrd::partial_cmp(&self.x, &other.x) {
147 ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
148 ::core::cmp::PartialOrd::partial_cmp(&self.y, &other.y),
153 #[automatically_derived]
154 impl ::core::cmp::Ord for Point {
156 fn cmp(&self, other: &Point) -> ::core::cmp::Ordering {
157 match ::core::cmp::Ord::cmp(&self.x, &other.x) {
158 ::core::cmp::Ordering::Equal =>
159 ::core::cmp::Ord::cmp(&self.y, &other.y),
165 // A basic packed struct. Note: because this derives `Copy`, it gets the simple
166 // `clone` implemention that just does `*self`.
172 #[automatically_derived]
173 impl ::core::clone::Clone for PackedPoint {
175 fn clone(&self) -> PackedPoint {
176 let _: ::core::clone::AssertParamIsClone<u32>;
180 #[automatically_derived]
181 impl ::core::marker::Copy for PackedPoint { }
182 #[automatically_derived]
183 impl ::core::fmt::Debug for PackedPoint {
184 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
185 ::core::fmt::Formatter::debug_struct_field2_finish(f, "PackedPoint",
186 "x", &&{ self.x }, "y", &&{ self.y })
189 #[automatically_derived]
190 impl ::core::default::Default for PackedPoint {
192 fn default() -> PackedPoint {
194 x: ::core::default::Default::default(),
195 y: ::core::default::Default::default(),
199 #[automatically_derived]
200 impl ::core::hash::Hash for PackedPoint {
201 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
202 ::core::hash::Hash::hash(&{ self.x }, state);
203 ::core::hash::Hash::hash(&{ self.y }, state)
206 #[automatically_derived]
207 impl ::core::marker::StructuralPartialEq for PackedPoint { }
208 #[automatically_derived]
209 impl ::core::cmp::PartialEq for PackedPoint {
211 fn eq(&self, other: &PackedPoint) -> bool {
212 { self.x } == { other.x } && { self.y } == { other.y }
215 #[automatically_derived]
216 impl ::core::marker::StructuralEq for PackedPoint { }
217 #[automatically_derived]
218 impl ::core::cmp::Eq for PackedPoint {
222 fn assert_receiver_is_total_eq(&self) -> () {
223 let _: ::core::cmp::AssertParamIsEq<u32>;
226 #[automatically_derived]
227 impl ::core::cmp::PartialOrd for PackedPoint {
229 fn partial_cmp(&self, other: &PackedPoint)
230 -> ::core::option::Option<::core::cmp::Ordering> {
231 match ::core::cmp::PartialOrd::partial_cmp(&{ self.x }, &{ other.x })
233 ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
234 ::core::cmp::PartialOrd::partial_cmp(&{ self.y },
240 #[automatically_derived]
241 impl ::core::cmp::Ord for PackedPoint {
243 fn cmp(&self, other: &PackedPoint) -> ::core::cmp::Ordering {
244 match ::core::cmp::Ord::cmp(&{ self.x }, &{ other.x }) {
245 ::core::cmp::Ordering::Equal =>
246 ::core::cmp::Ord::cmp(&{ self.y }, &{ other.y }),
252 // A large struct. Note: because this derives `Copy`, it gets the simple
253 // `clone` implemention that just does `*self`.
264 #[automatically_derived]
265 impl ::core::clone::Clone for Big {
267 fn clone(&self) -> Big {
268 let _: ::core::clone::AssertParamIsClone<u32>;
272 #[automatically_derived]
273 impl ::core::marker::Copy for Big { }
274 #[automatically_derived]
275 impl ::core::fmt::Debug for Big {
276 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
277 let names: &'static _ =
278 &["b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8"];
279 let values: &[&dyn ::core::fmt::Debug] =
280 &[&&self.b1, &&self.b2, &&self.b3, &&self.b4, &&self.b5,
281 &&self.b6, &&self.b7, &&self.b8];
282 ::core::fmt::Formatter::debug_struct_fields_finish(f, "Big", names,
286 #[automatically_derived]
287 impl ::core::default::Default for Big {
289 fn default() -> Big {
291 b1: ::core::default::Default::default(),
292 b2: ::core::default::Default::default(),
293 b3: ::core::default::Default::default(),
294 b4: ::core::default::Default::default(),
295 b5: ::core::default::Default::default(),
296 b6: ::core::default::Default::default(),
297 b7: ::core::default::Default::default(),
298 b8: ::core::default::Default::default(),
302 #[automatically_derived]
303 impl ::core::hash::Hash for Big {
304 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
305 ::core::hash::Hash::hash(&self.b1, state);
306 ::core::hash::Hash::hash(&self.b2, state);
307 ::core::hash::Hash::hash(&self.b3, state);
308 ::core::hash::Hash::hash(&self.b4, state);
309 ::core::hash::Hash::hash(&self.b5, state);
310 ::core::hash::Hash::hash(&self.b6, state);
311 ::core::hash::Hash::hash(&self.b7, state);
312 ::core::hash::Hash::hash(&self.b8, state)
315 #[automatically_derived]
316 impl ::core::marker::StructuralPartialEq for Big { }
317 #[automatically_derived]
318 impl ::core::cmp::PartialEq for Big {
320 fn eq(&self, other: &Big) -> bool {
321 self.b1 == other.b1 && self.b2 == other.b2 && self.b3 == other.b3 &&
322 self.b4 == other.b4 && self.b5 == other.b5 &&
323 self.b6 == other.b6 && self.b7 == other.b7 &&
327 #[automatically_derived]
328 impl ::core::marker::StructuralEq for Big { }
329 #[automatically_derived]
330 impl ::core::cmp::Eq for Big {
334 fn assert_receiver_is_total_eq(&self) -> () {
335 let _: ::core::cmp::AssertParamIsEq<u32>;
338 #[automatically_derived]
339 impl ::core::cmp::PartialOrd for Big {
341 fn partial_cmp(&self, other: &Big)
342 -> ::core::option::Option<::core::cmp::Ordering> {
343 match ::core::cmp::PartialOrd::partial_cmp(&self.b1, &other.b1) {
344 ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
345 match ::core::cmp::PartialOrd::partial_cmp(&self.b2,
347 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
349 match ::core::cmp::PartialOrd::partial_cmp(&self.b3,
351 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
353 match ::core::cmp::PartialOrd::partial_cmp(&self.b4,
355 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
357 match ::core::cmp::PartialOrd::partial_cmp(&self.b5,
359 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
361 match ::core::cmp::PartialOrd::partial_cmp(&self.b6,
363 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
365 match ::core::cmp::PartialOrd::partial_cmp(&self.b7,
367 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
369 ::core::cmp::PartialOrd::partial_cmp(&self.b8, &other.b8),
386 #[automatically_derived]
387 impl ::core::cmp::Ord for Big {
389 fn cmp(&self, other: &Big) -> ::core::cmp::Ordering {
390 match ::core::cmp::Ord::cmp(&self.b1, &other.b1) {
391 ::core::cmp::Ordering::Equal =>
392 match ::core::cmp::Ord::cmp(&self.b2, &other.b2) {
393 ::core::cmp::Ordering::Equal =>
394 match ::core::cmp::Ord::cmp(&self.b3, &other.b3) {
395 ::core::cmp::Ordering::Equal =>
396 match ::core::cmp::Ord::cmp(&self.b4, &other.b4) {
397 ::core::cmp::Ordering::Equal =>
398 match ::core::cmp::Ord::cmp(&self.b5, &other.b5) {
399 ::core::cmp::Ordering::Equal =>
400 match ::core::cmp::Ord::cmp(&self.b6, &other.b6) {
401 ::core::cmp::Ordering::Equal =>
402 match ::core::cmp::Ord::cmp(&self.b7, &other.b7) {
403 ::core::cmp::Ordering::Equal =>
404 ::core::cmp::Ord::cmp(&self.b8, &other.b8),
422 // A struct that doesn't impl `Copy`, which means it gets the non-simple
423 // `clone` implemention that clones the fields individually.
425 #[automatically_derived]
426 impl ::core::clone::Clone for NonCopy {
428 fn clone(&self) -> NonCopy {
429 NonCopy(::core::clone::Clone::clone(&self.0))
433 // A packed struct that doesn't impl `Copy`, which means it gets the non-simple
434 // `clone` implemention that clones the fields individually.
436 struct PackedNonCopy(u32);
437 #[automatically_derived]
438 impl ::core::clone::Clone for PackedNonCopy {
440 fn clone(&self) -> PackedNonCopy {
441 PackedNonCopy(::core::clone::Clone::clone(&{ self.0 }))
445 // A struct that impls `Copy` manually, which means it gets the non-simple
446 // `clone` implemention that clones the fields individually.
447 struct ManualCopy(u32);
448 #[automatically_derived]
449 impl ::core::clone::Clone for ManualCopy {
451 fn clone(&self) -> ManualCopy {
452 ManualCopy(::core::clone::Clone::clone(&self.0))
455 impl Copy for ManualCopy {}
457 // A packed struct that impls `Copy` manually, which means it gets the
458 // non-simple `clone` implemention that clones the fields individually.
460 struct PackedManualCopy(u32);
461 #[automatically_derived]
462 impl ::core::clone::Clone for PackedManualCopy {
464 fn clone(&self) -> PackedManualCopy {
465 PackedManualCopy(::core::clone::Clone::clone(&{ self.0 }))
468 impl Copy for PackedManualCopy {}
470 // A struct with an unsized field. Some derives are not usable in this case.
471 struct Unsized([u32]);
472 #[automatically_derived]
473 impl ::core::fmt::Debug for Unsized {
474 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
475 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Unsized",
479 #[automatically_derived]
480 impl ::core::hash::Hash for Unsized {
481 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
482 ::core::hash::Hash::hash(&self.0, state)
485 #[automatically_derived]
486 impl ::core::marker::StructuralPartialEq for Unsized { }
487 #[automatically_derived]
488 impl ::core::cmp::PartialEq for Unsized {
490 fn eq(&self, other: &Unsized) -> bool { self.0 == other.0 }
492 #[automatically_derived]
493 impl ::core::marker::StructuralEq for Unsized { }
494 #[automatically_derived]
495 impl ::core::cmp::Eq for Unsized {
499 fn assert_receiver_is_total_eq(&self) -> () {
500 let _: ::core::cmp::AssertParamIsEq<[u32]>;
503 #[automatically_derived]
504 impl ::core::cmp::PartialOrd for Unsized {
506 fn partial_cmp(&self, other: &Unsized)
507 -> ::core::option::Option<::core::cmp::Ordering> {
508 ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
511 #[automatically_derived]
512 impl ::core::cmp::Ord for Unsized {
514 fn cmp(&self, other: &Unsized) -> ::core::cmp::Ordering {
515 ::core::cmp::Ord::cmp(&self.0, &other.0)
519 // A packed struct with an unsized `[u8]` field. This is currently allowed, but
520 // causes a warning and will be phased out at some point.
522 struct PackedUnsizedU8([u8]);
523 #[automatically_derived]
524 impl ::core::fmt::Debug for PackedUnsizedU8 {
525 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
526 ::core::fmt::Formatter::debug_tuple_field1_finish(f,
527 "PackedUnsizedU8", &&self.0)
530 #[automatically_derived]
531 impl ::core::hash::Hash for PackedUnsizedU8 {
532 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
533 ::core::hash::Hash::hash(&self.0, state)
541 // A generic struct involving an associated type.
542 struct Generic<T: Trait, U> {
547 #[automatically_derived]
548 impl<T: ::core::clone::Clone + Trait, U: ::core::clone::Clone>
549 ::core::clone::Clone for Generic<T, U> where T::A: ::core::clone::Clone {
551 fn clone(&self) -> Generic<T, U> {
553 t: ::core::clone::Clone::clone(&self.t),
554 ta: ::core::clone::Clone::clone(&self.ta),
555 u: ::core::clone::Clone::clone(&self.u),
559 #[automatically_derived]
560 impl<T: ::core::marker::Copy + Trait, U: ::core::marker::Copy>
561 ::core::marker::Copy for Generic<T, U> where T::A: ::core::marker::Copy {
563 #[automatically_derived]
564 impl<T: ::core::fmt::Debug + Trait, U: ::core::fmt::Debug> ::core::fmt::Debug
565 for Generic<T, U> where T::A: ::core::fmt::Debug {
566 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
567 ::core::fmt::Formatter::debug_struct_field3_finish(f, "Generic", "t",
568 &&self.t, "ta", &&self.ta, "u", &&self.u)
571 #[automatically_derived]
572 impl<T: ::core::default::Default + Trait, U: ::core::default::Default>
573 ::core::default::Default for Generic<T, U> where
574 T::A: ::core::default::Default {
576 fn default() -> Generic<T, U> {
578 t: ::core::default::Default::default(),
579 ta: ::core::default::Default::default(),
580 u: ::core::default::Default::default(),
584 #[automatically_derived]
585 impl<T: ::core::hash::Hash + Trait, U: ::core::hash::Hash> ::core::hash::Hash
586 for Generic<T, U> where T::A: ::core::hash::Hash {
587 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
588 ::core::hash::Hash::hash(&self.t, state);
589 ::core::hash::Hash::hash(&self.ta, state);
590 ::core::hash::Hash::hash(&self.u, state)
593 #[automatically_derived]
594 impl<T: Trait, U> ::core::marker::StructuralPartialEq for Generic<T, U> { }
595 #[automatically_derived]
596 impl<T: ::core::cmp::PartialEq + Trait, U: ::core::cmp::PartialEq>
597 ::core::cmp::PartialEq for Generic<T, U> where
598 T::A: ::core::cmp::PartialEq {
600 fn eq(&self, other: &Generic<T, U>) -> bool {
601 self.t == other.t && self.ta == other.ta && self.u == other.u
604 #[automatically_derived]
605 impl<T: Trait, U> ::core::marker::StructuralEq for Generic<T, U> { }
606 #[automatically_derived]
607 impl<T: ::core::cmp::Eq + Trait, U: ::core::cmp::Eq> ::core::cmp::Eq for
608 Generic<T, U> where T::A: ::core::cmp::Eq {
612 fn assert_receiver_is_total_eq(&self) -> () {
613 let _: ::core::cmp::AssertParamIsEq<T>;
614 let _: ::core::cmp::AssertParamIsEq<T::A>;
615 let _: ::core::cmp::AssertParamIsEq<U>;
618 #[automatically_derived]
619 impl<T: ::core::cmp::PartialOrd + Trait, U: ::core::cmp::PartialOrd>
620 ::core::cmp::PartialOrd for Generic<T, U> where
621 T::A: ::core::cmp::PartialOrd {
623 fn partial_cmp(&self, other: &Generic<T, U>)
624 -> ::core::option::Option<::core::cmp::Ordering> {
625 match ::core::cmp::PartialOrd::partial_cmp(&self.t, &other.t) {
626 ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
627 match ::core::cmp::PartialOrd::partial_cmp(&self.ta,
629 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
630 => ::core::cmp::PartialOrd::partial_cmp(&self.u, &other.u),
637 #[automatically_derived]
638 impl<T: ::core::cmp::Ord + Trait, U: ::core::cmp::Ord> ::core::cmp::Ord for
639 Generic<T, U> where T::A: ::core::cmp::Ord {
641 fn cmp(&self, other: &Generic<T, U>) -> ::core::cmp::Ordering {
642 match ::core::cmp::Ord::cmp(&self.t, &other.t) {
643 ::core::cmp::Ordering::Equal =>
644 match ::core::cmp::Ord::cmp(&self.ta, &other.ta) {
645 ::core::cmp::Ordering::Equal =>
646 ::core::cmp::Ord::cmp(&self.u, &other.u),
654 // A packed, generic tuple struct involving an associated type. Because it is
655 // packed, a `T: Copy` bound is added to all impls (and where clauses within
656 // them) except for `Default`. This is because we must access fields using
657 // copies (e.g. `&{self.0}`), instead of using direct references (e.g.
658 // `&self.0`) which may be misaligned in a packed struct.
660 struct PackedGeneric<T: Trait, U>(T, T::A, U);
661 #[automatically_derived]
662 impl<T: ::core::clone::Clone + ::core::marker::Copy + Trait,
663 U: ::core::clone::Clone + ::core::marker::Copy> ::core::clone::Clone for
664 PackedGeneric<T, U> where T::A: ::core::clone::Clone +
665 ::core::marker::Copy {
667 fn clone(&self) -> PackedGeneric<T, U> {
668 PackedGeneric(::core::clone::Clone::clone(&{ self.0 }),
669 ::core::clone::Clone::clone(&{ self.1 }),
670 ::core::clone::Clone::clone(&{ self.2 }))
673 #[automatically_derived]
674 impl<T: ::core::marker::Copy + Trait, U: ::core::marker::Copy>
675 ::core::marker::Copy for PackedGeneric<T, U> where
676 T::A: ::core::marker::Copy {
678 #[automatically_derived]
679 impl<T: ::core::fmt::Debug + ::core::marker::Copy + Trait,
680 U: ::core::fmt::Debug + ::core::marker::Copy> ::core::fmt::Debug for
681 PackedGeneric<T, U> where T::A: ::core::fmt::Debug + ::core::marker::Copy
683 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
684 ::core::fmt::Formatter::debug_tuple_field3_finish(f, "PackedGeneric",
685 &&{ self.0 }, &&{ self.1 }, &&{ self.2 })
688 #[automatically_derived]
689 impl<T: ::core::default::Default + Trait, U: ::core::default::Default>
690 ::core::default::Default for PackedGeneric<T, U> where
691 T::A: ::core::default::Default {
693 fn default() -> PackedGeneric<T, U> {
694 PackedGeneric(::core::default::Default::default(),
695 ::core::default::Default::default(),
696 ::core::default::Default::default())
699 #[automatically_derived]
700 impl<T: ::core::hash::Hash + ::core::marker::Copy + Trait,
701 U: ::core::hash::Hash + ::core::marker::Copy> ::core::hash::Hash for
702 PackedGeneric<T, U> where T::A: ::core::hash::Hash + ::core::marker::Copy
704 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
705 ::core::hash::Hash::hash(&{ self.0 }, state);
706 ::core::hash::Hash::hash(&{ self.1 }, state);
707 ::core::hash::Hash::hash(&{ self.2 }, state)
710 #[automatically_derived]
711 impl<T: Trait, U> ::core::marker::StructuralPartialEq for PackedGeneric<T, U>
714 #[automatically_derived]
715 impl<T: ::core::cmp::PartialEq + ::core::marker::Copy + Trait,
716 U: ::core::cmp::PartialEq + ::core::marker::Copy> ::core::cmp::PartialEq
717 for PackedGeneric<T, U> where T::A: ::core::cmp::PartialEq +
718 ::core::marker::Copy {
720 fn eq(&self, other: &PackedGeneric<T, U>) -> bool {
721 { self.0 } == { other.0 } && { self.1 } == { other.1 } &&
722 { self.2 } == { other.2 }
725 #[automatically_derived]
726 impl<T: Trait, U> ::core::marker::StructuralEq for PackedGeneric<T, U> { }
727 #[automatically_derived]
728 impl<T: ::core::cmp::Eq + ::core::marker::Copy + Trait, U: ::core::cmp::Eq +
729 ::core::marker::Copy> ::core::cmp::Eq for PackedGeneric<T, U> where
730 T::A: ::core::cmp::Eq + ::core::marker::Copy {
734 fn assert_receiver_is_total_eq(&self) -> () {
735 let _: ::core::cmp::AssertParamIsEq<T>;
736 let _: ::core::cmp::AssertParamIsEq<T::A>;
737 let _: ::core::cmp::AssertParamIsEq<U>;
740 #[automatically_derived]
741 impl<T: ::core::cmp::PartialOrd + ::core::marker::Copy + Trait,
742 U: ::core::cmp::PartialOrd + ::core::marker::Copy> ::core::cmp::PartialOrd
743 for PackedGeneric<T, U> where T::A: ::core::cmp::PartialOrd +
744 ::core::marker::Copy {
746 fn partial_cmp(&self, other: &PackedGeneric<T, U>)
747 -> ::core::option::Option<::core::cmp::Ordering> {
748 match ::core::cmp::PartialOrd::partial_cmp(&{ self.0 }, &{ other.0 })
750 ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
751 match ::core::cmp::PartialOrd::partial_cmp(&{ self.1 },
753 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
755 ::core::cmp::PartialOrd::partial_cmp(&{ self.2 },
763 #[automatically_derived]
764 impl<T: ::core::cmp::Ord + ::core::marker::Copy + Trait, U: ::core::cmp::Ord +
765 ::core::marker::Copy> ::core::cmp::Ord for PackedGeneric<T, U> where
766 T::A: ::core::cmp::Ord + ::core::marker::Copy {
768 fn cmp(&self, other: &PackedGeneric<T, U>) -> ::core::cmp::Ordering {
769 match ::core::cmp::Ord::cmp(&{ self.0 }, &{ other.0 }) {
770 ::core::cmp::Ordering::Equal =>
771 match ::core::cmp::Ord::cmp(&{ self.1 }, &{ other.1 }) {
772 ::core::cmp::Ordering::Equal =>
773 ::core::cmp::Ord::cmp(&{ self.2 }, &{ other.2 }),
783 #[automatically_derived]
784 impl ::core::clone::Clone for Enum0 {
786 fn clone(&self) -> Enum0 { *self }
788 #[automatically_derived]
789 impl ::core::marker::Copy for Enum0 { }
790 #[automatically_derived]
791 impl ::core::fmt::Debug for Enum0 {
792 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
793 unsafe { ::core::intrinsics::unreachable() }
796 #[automatically_derived]
797 impl ::core::hash::Hash for Enum0 {
798 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
799 unsafe { ::core::intrinsics::unreachable() }
802 #[automatically_derived]
803 impl ::core::marker::StructuralPartialEq for Enum0 { }
804 #[automatically_derived]
805 impl ::core::cmp::PartialEq for Enum0 {
807 fn eq(&self, other: &Enum0) -> bool {
808 unsafe { ::core::intrinsics::unreachable() }
811 #[automatically_derived]
812 impl ::core::marker::StructuralEq for Enum0 { }
813 #[automatically_derived]
814 impl ::core::cmp::Eq for Enum0 {
818 fn assert_receiver_is_total_eq(&self) -> () {}
820 #[automatically_derived]
821 impl ::core::cmp::PartialOrd for Enum0 {
823 fn partial_cmp(&self, other: &Enum0)
824 -> ::core::option::Option<::core::cmp::Ordering> {
825 unsafe { ::core::intrinsics::unreachable() }
828 #[automatically_derived]
829 impl ::core::cmp::Ord for Enum0 {
831 fn cmp(&self, other: &Enum0) -> ::core::cmp::Ordering {
832 unsafe { ::core::intrinsics::unreachable() }
836 // A single-variant enum.
842 #[automatically_derived]
843 impl ::core::clone::Clone for Enum1 {
845 fn clone(&self) -> Enum1 {
847 Enum1::Single { x: __self_0 } =>
848 Enum1::Single { x: ::core::clone::Clone::clone(__self_0) },
852 #[automatically_derived]
853 impl ::core::fmt::Debug for Enum1 {
854 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
856 Enum1::Single { x: __self_0 } =>
857 ::core::fmt::Formatter::debug_struct_field1_finish(f,
858 "Single", "x", &__self_0),
862 #[automatically_derived]
863 impl ::core::hash::Hash for Enum1 {
864 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
866 Enum1::Single { x: __self_0 } =>
867 ::core::hash::Hash::hash(__self_0, state),
871 #[automatically_derived]
872 impl ::core::marker::StructuralPartialEq for Enum1 { }
873 #[automatically_derived]
874 impl ::core::cmp::PartialEq for Enum1 {
876 fn eq(&self, other: &Enum1) -> bool {
877 match (self, other) {
878 (Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg1_0 }) =>
879 *__self_0 == *__arg1_0,
883 #[automatically_derived]
884 impl ::core::marker::StructuralEq for Enum1 { }
885 #[automatically_derived]
886 impl ::core::cmp::Eq for Enum1 {
890 fn assert_receiver_is_total_eq(&self) -> () {
891 let _: ::core::cmp::AssertParamIsEq<u32>;
894 #[automatically_derived]
895 impl ::core::cmp::PartialOrd for Enum1 {
897 fn partial_cmp(&self, other: &Enum1)
898 -> ::core::option::Option<::core::cmp::Ordering> {
899 match (self, other) {
900 (Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg1_0 }) =>
901 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
905 #[automatically_derived]
906 impl ::core::cmp::Ord for Enum1 {
908 fn cmp(&self, other: &Enum1) -> ::core::cmp::Ordering {
909 match (self, other) {
910 (Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg1_0 }) =>
911 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
916 // A C-like, fieldless enum with a single variant.
922 #[automatically_derived]
923 impl ::core::clone::Clone for Fieldless1 {
925 fn clone(&self) -> Fieldless1 { Fieldless1::A }
927 #[automatically_derived]
928 impl ::core::fmt::Debug for Fieldless1 {
929 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
930 ::core::fmt::Formatter::write_str(f, "A")
933 #[automatically_derived]
934 impl ::core::default::Default for Fieldless1 {
936 fn default() -> Fieldless1 { Self::A }
938 #[automatically_derived]
939 impl ::core::hash::Hash for Fieldless1 {
940 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
942 #[automatically_derived]
943 impl ::core::marker::StructuralPartialEq for Fieldless1 { }
944 #[automatically_derived]
945 impl ::core::cmp::PartialEq for Fieldless1 {
947 fn eq(&self, other: &Fieldless1) -> bool { true }
949 #[automatically_derived]
950 impl ::core::marker::StructuralEq for Fieldless1 { }
951 #[automatically_derived]
952 impl ::core::cmp::Eq for Fieldless1 {
956 fn assert_receiver_is_total_eq(&self) -> () {}
958 #[automatically_derived]
959 impl ::core::cmp::PartialOrd for Fieldless1 {
961 fn partial_cmp(&self, other: &Fieldless1)
962 -> ::core::option::Option<::core::cmp::Ordering> {
963 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
966 #[automatically_derived]
967 impl ::core::cmp::Ord for Fieldless1 {
969 fn cmp(&self, other: &Fieldless1) -> ::core::cmp::Ordering {
970 ::core::cmp::Ordering::Equal
974 // A C-like, fieldless enum.
982 #[automatically_derived]
983 impl ::core::clone::Clone for Fieldless {
985 fn clone(&self) -> Fieldless { *self }
987 #[automatically_derived]
988 impl ::core::marker::Copy for Fieldless { }
989 #[automatically_derived]
990 impl ::core::fmt::Debug for Fieldless {
991 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
992 ::core::fmt::Formatter::write_str(f,
1000 #[automatically_derived]
1001 impl ::core::default::Default for Fieldless {
1003 fn default() -> Fieldless { Self::A }
1005 #[automatically_derived]
1006 impl ::core::hash::Hash for Fieldless {
1007 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
1008 let __self_tag = ::core::intrinsics::discriminant_value(self);
1009 ::core::hash::Hash::hash(&__self_tag, state)
1012 #[automatically_derived]
1013 impl ::core::marker::StructuralPartialEq for Fieldless { }
1014 #[automatically_derived]
1015 impl ::core::cmp::PartialEq for Fieldless {
1017 fn eq(&self, other: &Fieldless) -> bool {
1018 let __self_tag = ::core::intrinsics::discriminant_value(self);
1019 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1020 __self_tag == __arg1_tag
1023 #[automatically_derived]
1024 impl ::core::marker::StructuralEq for Fieldless { }
1025 #[automatically_derived]
1026 impl ::core::cmp::Eq for Fieldless {
1030 fn assert_receiver_is_total_eq(&self) -> () {}
1032 #[automatically_derived]
1033 impl ::core::cmp::PartialOrd for Fieldless {
1035 fn partial_cmp(&self, other: &Fieldless)
1036 -> ::core::option::Option<::core::cmp::Ordering> {
1037 let __self_tag = ::core::intrinsics::discriminant_value(self);
1038 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1039 ::core::cmp::PartialOrd::partial_cmp(&__self_tag, &__arg1_tag)
1042 #[automatically_derived]
1043 impl ::core::cmp::Ord for Fieldless {
1045 fn cmp(&self, other: &Fieldless) -> ::core::cmp::Ordering {
1046 let __self_tag = ::core::intrinsics::discriminant_value(self);
1047 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1048 ::core::cmp::Ord::cmp(&__self_tag, &__arg1_tag)
1052 // An enum with multiple fieldless and fielded variants.
1064 #[automatically_derived]
1065 impl ::core::clone::Clone for Mixed {
1067 fn clone(&self) -> Mixed {
1068 let _: ::core::clone::AssertParamIsClone<u32>;
1069 let _: ::core::clone::AssertParamIsClone<Option<u32>>;
1070 let _: ::core::clone::AssertParamIsClone<Option<i32>>;
1074 #[automatically_derived]
1075 impl ::core::marker::Copy for Mixed { }
1076 #[automatically_derived]
1077 impl ::core::fmt::Debug for Mixed {
1078 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1080 Mixed::P => ::core::fmt::Formatter::write_str(f, "P"),
1081 Mixed::Q => ::core::fmt::Formatter::write_str(f, "Q"),
1082 Mixed::R(__self_0) =>
1083 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "R",
1085 Mixed::S { d1: __self_0, d2: __self_1 } =>
1086 ::core::fmt::Formatter::debug_struct_field2_finish(f, "S",
1087 "d1", &__self_0, "d2", &__self_1),
1091 #[automatically_derived]
1092 impl ::core::default::Default for Mixed {
1094 fn default() -> Mixed { Self::P }
1096 #[automatically_derived]
1097 impl ::core::hash::Hash for Mixed {
1098 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
1099 let __self_tag = ::core::intrinsics::discriminant_value(self);
1100 ::core::hash::Hash::hash(&__self_tag, state);
1102 Mixed::R(__self_0) => ::core::hash::Hash::hash(__self_0, state),
1103 Mixed::S { d1: __self_0, d2: __self_1 } => {
1104 ::core::hash::Hash::hash(__self_0, state);
1105 ::core::hash::Hash::hash(__self_1, state)
1111 #[automatically_derived]
1112 impl ::core::marker::StructuralPartialEq for Mixed { }
1113 #[automatically_derived]
1114 impl ::core::cmp::PartialEq for Mixed {
1116 fn eq(&self, other: &Mixed) -> bool {
1117 let __self_tag = ::core::intrinsics::discriminant_value(self);
1118 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1119 __self_tag == __arg1_tag &&
1120 match (self, other) {
1121 (Mixed::R(__self_0), Mixed::R(__arg1_0)) =>
1122 *__self_0 == *__arg1_0,
1123 (Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
1124 d1: __arg1_0, d2: __arg1_1 }) =>
1125 *__self_0 == *__arg1_0 && *__self_1 == *__arg1_1,
1130 #[automatically_derived]
1131 impl ::core::marker::StructuralEq for Mixed { }
1132 #[automatically_derived]
1133 impl ::core::cmp::Eq for Mixed {
1137 fn assert_receiver_is_total_eq(&self) -> () {
1138 let _: ::core::cmp::AssertParamIsEq<u32>;
1139 let _: ::core::cmp::AssertParamIsEq<Option<u32>>;
1140 let _: ::core::cmp::AssertParamIsEq<Option<i32>>;
1143 #[automatically_derived]
1144 impl ::core::cmp::PartialOrd for Mixed {
1146 fn partial_cmp(&self, other: &Mixed)
1147 -> ::core::option::Option<::core::cmp::Ordering> {
1148 let __self_tag = ::core::intrinsics::discriminant_value(self);
1149 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1150 match (self, other) {
1151 (Mixed::R(__self_0), Mixed::R(__arg1_0)) =>
1152 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1153 (Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
1154 d1: __arg1_0, d2: __arg1_1 }) =>
1155 match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
1157 ::core::option::Option::Some(::core::cmp::Ordering::Equal)
1158 => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
1162 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1167 #[automatically_derived]
1168 impl ::core::cmp::Ord for Mixed {
1170 fn cmp(&self, other: &Mixed) -> ::core::cmp::Ordering {
1171 let __self_tag = ::core::intrinsics::discriminant_value(self);
1172 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1173 match ::core::cmp::Ord::cmp(&__self_tag, &__arg1_tag) {
1174 ::core::cmp::Ordering::Equal =>
1175 match (self, other) {
1176 (Mixed::R(__self_0), Mixed::R(__arg1_0)) =>
1177 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1178 (Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
1179 d1: __arg1_0, d2: __arg1_1 }) =>
1180 match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
1181 ::core::cmp::Ordering::Equal =>
1182 ::core::cmp::Ord::cmp(__self_1, __arg1_1),
1185 _ => ::core::cmp::Ordering::Equal,
1192 // An enum with no fieldless variants. Note that `Default` cannot be derived
1194 enum Fielded { X(u32), Y(bool), Z(Option<i32>), }
1195 #[automatically_derived]
1196 impl ::core::clone::Clone for Fielded {
1198 fn clone(&self) -> Fielded {
1200 Fielded::X(__self_0) =>
1201 Fielded::X(::core::clone::Clone::clone(__self_0)),
1202 Fielded::Y(__self_0) =>
1203 Fielded::Y(::core::clone::Clone::clone(__self_0)),
1204 Fielded::Z(__self_0) =>
1205 Fielded::Z(::core::clone::Clone::clone(__self_0)),
1209 #[automatically_derived]
1210 impl ::core::fmt::Debug for Fielded {
1211 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1213 Fielded::X(__self_0) =>
1214 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "X",
1216 Fielded::Y(__self_0) =>
1217 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Y",
1219 Fielded::Z(__self_0) =>
1220 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Z",
1225 #[automatically_derived]
1226 impl ::core::hash::Hash for Fielded {
1227 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
1228 let __self_tag = ::core::intrinsics::discriminant_value(self);
1229 ::core::hash::Hash::hash(&__self_tag, state);
1231 Fielded::X(__self_0) => ::core::hash::Hash::hash(__self_0, state),
1232 Fielded::Y(__self_0) => ::core::hash::Hash::hash(__self_0, state),
1233 Fielded::Z(__self_0) => ::core::hash::Hash::hash(__self_0, state),
1237 #[automatically_derived]
1238 impl ::core::marker::StructuralPartialEq for Fielded { }
1239 #[automatically_derived]
1240 impl ::core::cmp::PartialEq for Fielded {
1242 fn eq(&self, other: &Fielded) -> bool {
1243 let __self_tag = ::core::intrinsics::discriminant_value(self);
1244 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1245 __self_tag == __arg1_tag &&
1246 match (self, other) {
1247 (Fielded::X(__self_0), Fielded::X(__arg1_0)) =>
1248 *__self_0 == *__arg1_0,
1249 (Fielded::Y(__self_0), Fielded::Y(__arg1_0)) =>
1250 *__self_0 == *__arg1_0,
1251 (Fielded::Z(__self_0), Fielded::Z(__arg1_0)) =>
1252 *__self_0 == *__arg1_0,
1253 _ => unsafe { ::core::intrinsics::unreachable() }
1257 #[automatically_derived]
1258 impl ::core::marker::StructuralEq for Fielded { }
1259 #[automatically_derived]
1260 impl ::core::cmp::Eq for Fielded {
1264 fn assert_receiver_is_total_eq(&self) -> () {
1265 let _: ::core::cmp::AssertParamIsEq<u32>;
1266 let _: ::core::cmp::AssertParamIsEq<bool>;
1267 let _: ::core::cmp::AssertParamIsEq<Option<i32>>;
1270 #[automatically_derived]
1271 impl ::core::cmp::PartialOrd for Fielded {
1273 fn partial_cmp(&self, other: &Fielded)
1274 -> ::core::option::Option<::core::cmp::Ordering> {
1275 let __self_tag = ::core::intrinsics::discriminant_value(self);
1276 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1277 match (self, other) {
1278 (Fielded::X(__self_0), Fielded::X(__arg1_0)) =>
1279 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1280 (Fielded::Y(__self_0), Fielded::Y(__arg1_0)) =>
1281 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1282 (Fielded::Z(__self_0), Fielded::Z(__arg1_0)) =>
1283 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1285 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1290 #[automatically_derived]
1291 impl ::core::cmp::Ord for Fielded {
1293 fn cmp(&self, other: &Fielded) -> ::core::cmp::Ordering {
1294 let __self_tag = ::core::intrinsics::discriminant_value(self);
1295 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1296 match ::core::cmp::Ord::cmp(&__self_tag, &__arg1_tag) {
1297 ::core::cmp::Ordering::Equal =>
1298 match (self, other) {
1299 (Fielded::X(__self_0), Fielded::X(__arg1_0)) =>
1300 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1301 (Fielded::Y(__self_0), Fielded::Y(__arg1_0)) =>
1302 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1303 (Fielded::Z(__self_0), Fielded::Z(__arg1_0)) =>
1304 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1305 _ => unsafe { ::core::intrinsics::unreachable() }
1312 // A generic enum. Note that `Default` cannot be derived for this enum.
1313 enum EnumGeneric<T, U> { One(T), Two(U), }
1314 #[automatically_derived]
1315 impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
1316 for EnumGeneric<T, U> {
1318 fn clone(&self) -> EnumGeneric<T, U> {
1320 EnumGeneric::One(__self_0) =>
1321 EnumGeneric::One(::core::clone::Clone::clone(__self_0)),
1322 EnumGeneric::Two(__self_0) =>
1323 EnumGeneric::Two(::core::clone::Clone::clone(__self_0)),
1327 #[automatically_derived]
1328 impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
1329 for EnumGeneric<T, U> {
1331 #[automatically_derived]
1332 impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
1334 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1336 EnumGeneric::One(__self_0) =>
1337 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "One",
1339 EnumGeneric::Two(__self_0) =>
1340 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Two",
1345 #[automatically_derived]
1346 impl<T: ::core::hash::Hash, U: ::core::hash::Hash> ::core::hash::Hash for
1348 fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
1349 let __self_tag = ::core::intrinsics::discriminant_value(self);
1350 ::core::hash::Hash::hash(&__self_tag, state);
1352 EnumGeneric::One(__self_0) =>
1353 ::core::hash::Hash::hash(__self_0, state),
1354 EnumGeneric::Two(__self_0) =>
1355 ::core::hash::Hash::hash(__self_0, state),
1359 #[automatically_derived]
1360 impl<T, U> ::core::marker::StructuralPartialEq for EnumGeneric<T, U> { }
1361 #[automatically_derived]
1362 impl<T: ::core::cmp::PartialEq, U: ::core::cmp::PartialEq>
1363 ::core::cmp::PartialEq for EnumGeneric<T, U> {
1365 fn eq(&self, other: &EnumGeneric<T, U>) -> bool {
1366 let __self_tag = ::core::intrinsics::discriminant_value(self);
1367 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1368 __self_tag == __arg1_tag &&
1369 match (self, other) {
1370 (EnumGeneric::One(__self_0), EnumGeneric::One(__arg1_0)) =>
1371 *__self_0 == *__arg1_0,
1372 (EnumGeneric::Two(__self_0), EnumGeneric::Two(__arg1_0)) =>
1373 *__self_0 == *__arg1_0,
1374 _ => unsafe { ::core::intrinsics::unreachable() }
1378 #[automatically_derived]
1379 impl<T, U> ::core::marker::StructuralEq for EnumGeneric<T, U> { }
1380 #[automatically_derived]
1381 impl<T: ::core::cmp::Eq, U: ::core::cmp::Eq> ::core::cmp::Eq for
1386 fn assert_receiver_is_total_eq(&self) -> () {
1387 let _: ::core::cmp::AssertParamIsEq<T>;
1388 let _: ::core::cmp::AssertParamIsEq<U>;
1391 #[automatically_derived]
1392 impl<T: ::core::cmp::PartialOrd, U: ::core::cmp::PartialOrd>
1393 ::core::cmp::PartialOrd for EnumGeneric<T, U> {
1395 fn partial_cmp(&self, other: &EnumGeneric<T, U>)
1396 -> ::core::option::Option<::core::cmp::Ordering> {
1397 let __self_tag = ::core::intrinsics::discriminant_value(self);
1398 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1399 match (self, other) {
1400 (EnumGeneric::One(__self_0), EnumGeneric::One(__arg1_0)) =>
1401 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1402 (EnumGeneric::Two(__self_0), EnumGeneric::Two(__arg1_0)) =>
1403 ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
1405 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1410 #[automatically_derived]
1411 impl<T: ::core::cmp::Ord, U: ::core::cmp::Ord> ::core::cmp::Ord for
1414 fn cmp(&self, other: &EnumGeneric<T, U>) -> ::core::cmp::Ordering {
1415 let __self_tag = ::core::intrinsics::discriminant_value(self);
1416 let __arg1_tag = ::core::intrinsics::discriminant_value(other);
1417 match ::core::cmp::Ord::cmp(&__self_tag, &__arg1_tag) {
1418 ::core::cmp::Ordering::Equal =>
1419 match (self, other) {
1420 (EnumGeneric::One(__self_0), EnumGeneric::One(__arg1_0)) =>
1421 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1422 (EnumGeneric::Two(__self_0), EnumGeneric::Two(__arg1_0)) =>
1423 ::core::cmp::Ord::cmp(__self_0, __arg1_0),
1424 _ => unsafe { ::core::intrinsics::unreachable() }
1431 // A union. Most builtin traits are not derivable for unions.
1437 #[automatically_derived]
1438 impl ::core::clone::Clone for Union {
1440 fn clone(&self) -> Union {
1441 let _: ::core::clone::AssertParamIsCopy<Self>;
1445 #[automatically_derived]
1446 impl ::core::marker::Copy for Union { }