]> git.lizzy.rs Git - rust.git/blob - tests/ui/deriving/deriving-all-codegen.stdout
Fix syntax in `-Zunpretty-expanded` output for derived `PartialEq`.
[rust.git] / tests / ui / deriving / deriving-all-codegen.stdout
1 #![feature(prelude_import)]
2 // check-pass
3 // compile-flags: -Zunpretty=expanded
4 // edition:2021
5 //
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
9 // easier to review.
10 //
11 // [*] It excludes `Copy` in some cases, because that changes the code
12 // generated for `Clone`.
13 //
14 // [*] It excludes `RustcEncodable` and `RustDecodable`, which are obsolete and
15 // also require the `rustc_serialize` crate.
16
17 #![crate_type = "lib"]
18 #![allow(dead_code)]
19 #![allow(deprecated)]
20 #[prelude_import]
21 use std::prelude::rust_2021::*;
22 #[macro_use]
23 extern crate std;
24
25 // Empty struct.
26 struct Empty;
27 #[automatically_derived]
28 impl ::core::clone::Clone for Empty {
29     #[inline]
30     fn clone(&self) -> Empty { *self }
31 }
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")
38     }
39 }
40 #[automatically_derived]
41 impl ::core::default::Default for Empty {
42     #[inline]
43     fn default() -> Empty { Empty {} }
44 }
45 #[automatically_derived]
46 impl ::core::hash::Hash for Empty {
47     fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
48 }
49 #[automatically_derived]
50 impl ::core::marker::StructuralPartialEq for Empty { }
51 #[automatically_derived]
52 impl ::core::cmp::PartialEq for Empty {
53     #[inline]
54     fn eq(&self, other: &Empty) -> bool { true }
55 }
56 #[automatically_derived]
57 impl ::core::marker::StructuralEq for Empty { }
58 #[automatically_derived]
59 impl ::core::cmp::Eq for Empty {
60     #[inline]
61     #[doc(hidden)]
62     #[no_coverage]
63     fn assert_receiver_is_total_eq(&self) -> () {}
64 }
65 #[automatically_derived]
66 impl ::core::cmp::PartialOrd for Empty {
67     #[inline]
68     fn partial_cmp(&self, other: &Empty)
69         -> ::core::option::Option<::core::cmp::Ordering> {
70         ::core::option::Option::Some(::core::cmp::Ordering::Equal)
71     }
72 }
73 #[automatically_derived]
74 impl ::core::cmp::Ord for Empty {
75     #[inline]
76     fn cmp(&self, other: &Empty) -> ::core::cmp::Ordering {
77         ::core::cmp::Ordering::Equal
78     }
79 }
80
81 // A basic struct. Note: because this derives `Copy`, it gets the simple
82 // `clone` implemention that just does `*self`.
83 struct Point {
84     x: u32,
85     y: u32,
86 }
87 #[automatically_derived]
88 impl ::core::clone::Clone for Point {
89     #[inline]
90     fn clone(&self) -> Point {
91         let _: ::core::clone::AssertParamIsClone<u32>;
92         *self
93     }
94 }
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)
102     }
103 }
104 #[automatically_derived]
105 impl ::core::default::Default for Point {
106     #[inline]
107     fn default() -> Point {
108         Point {
109             x: ::core::default::Default::default(),
110             y: ::core::default::Default::default(),
111         }
112     }
113 }
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)
119     }
120 }
121 #[automatically_derived]
122 impl ::core::marker::StructuralPartialEq for Point { }
123 #[automatically_derived]
124 impl ::core::cmp::PartialEq for Point {
125     #[inline]
126     fn eq(&self, other: &Point) -> bool {
127         self.x == other.x && self.y == other.y
128     }
129 }
130 #[automatically_derived]
131 impl ::core::marker::StructuralEq for Point { }
132 #[automatically_derived]
133 impl ::core::cmp::Eq for Point {
134     #[inline]
135     #[doc(hidden)]
136     #[no_coverage]
137     fn assert_receiver_is_total_eq(&self) -> () {
138         let _: ::core::cmp::AssertParamIsEq<u32>;
139     }
140 }
141 #[automatically_derived]
142 impl ::core::cmp::PartialOrd for Point {
143     #[inline]
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),
149             cmp => cmp,
150         }
151     }
152 }
153 #[automatically_derived]
154 impl ::core::cmp::Ord for Point {
155     #[inline]
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),
160             cmp => cmp,
161         }
162     }
163 }
164
165 // A basic packed struct. Note: because this derives `Copy`, it gets the simple
166 // `clone` implemention that just does `*self`.
167 #[repr(packed)]
168 struct PackedPoint {
169     x: u32,
170     y: u32,
171 }
172 #[automatically_derived]
173 impl ::core::clone::Clone for PackedPoint {
174     #[inline]
175     fn clone(&self) -> PackedPoint {
176         let _: ::core::clone::AssertParamIsClone<u32>;
177         *self
178     }
179 }
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 })
187     }
188 }
189 #[automatically_derived]
190 impl ::core::default::Default for PackedPoint {
191     #[inline]
192     fn default() -> PackedPoint {
193         PackedPoint {
194             x: ::core::default::Default::default(),
195             y: ::core::default::Default::default(),
196         }
197     }
198 }
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)
204     }
205 }
206 #[automatically_derived]
207 impl ::core::marker::StructuralPartialEq for PackedPoint { }
208 #[automatically_derived]
209 impl ::core::cmp::PartialEq for PackedPoint {
210     #[inline]
211     fn eq(&self, other: &PackedPoint) -> bool {
212         ({ self.x }) == ({ other.x }) && ({ self.y }) == ({ other.y })
213     }
214 }
215 #[automatically_derived]
216 impl ::core::marker::StructuralEq for PackedPoint { }
217 #[automatically_derived]
218 impl ::core::cmp::Eq for PackedPoint {
219     #[inline]
220     #[doc(hidden)]
221     #[no_coverage]
222     fn assert_receiver_is_total_eq(&self) -> () {
223         let _: ::core::cmp::AssertParamIsEq<u32>;
224     }
225 }
226 #[automatically_derived]
227 impl ::core::cmp::PartialOrd for PackedPoint {
228     #[inline]
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 })
232             {
233             ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
234                 ::core::cmp::PartialOrd::partial_cmp(&{ self.y },
235                     &{ other.y }),
236             cmp => cmp,
237         }
238     }
239 }
240 #[automatically_derived]
241 impl ::core::cmp::Ord for PackedPoint {
242     #[inline]
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 }),
247             cmp => cmp,
248         }
249     }
250 }
251
252 // A large struct. Note: because this derives `Copy`, it gets the simple
253 // `clone` implemention that just does `*self`.
254 struct Big {
255     b1: u32,
256     b2: u32,
257     b3: u32,
258     b4: u32,
259     b5: u32,
260     b6: u32,
261     b7: u32,
262     b8: u32,
263 }
264 #[automatically_derived]
265 impl ::core::clone::Clone for Big {
266     #[inline]
267     fn clone(&self) -> Big {
268         let _: ::core::clone::AssertParamIsClone<u32>;
269         *self
270     }
271 }
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,
283             values)
284     }
285 }
286 #[automatically_derived]
287 impl ::core::default::Default for Big {
288     #[inline]
289     fn default() -> Big {
290         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(),
299         }
300     }
301 }
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)
313     }
314 }
315 #[automatically_derived]
316 impl ::core::marker::StructuralPartialEq for Big { }
317 #[automatically_derived]
318 impl ::core::cmp::PartialEq for Big {
319     #[inline]
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 &&
324             self.b8 == other.b8
325     }
326 }
327 #[automatically_derived]
328 impl ::core::marker::StructuralEq for Big { }
329 #[automatically_derived]
330 impl ::core::cmp::Eq for Big {
331     #[inline]
332     #[doc(hidden)]
333     #[no_coverage]
334     fn assert_receiver_is_total_eq(&self) -> () {
335         let _: ::core::cmp::AssertParamIsEq<u32>;
336     }
337 }
338 #[automatically_derived]
339 impl ::core::cmp::PartialOrd for Big {
340     #[inline]
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,
346                         &other.b2) {
347                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
348                         =>
349                         match ::core::cmp::PartialOrd::partial_cmp(&self.b3,
350                                 &other.b3) {
351                             ::core::option::Option::Some(::core::cmp::Ordering::Equal)
352                                 =>
353                                 match ::core::cmp::PartialOrd::partial_cmp(&self.b4,
354                                         &other.b4) {
355                                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
356                                         =>
357                                         match ::core::cmp::PartialOrd::partial_cmp(&self.b5,
358                                                 &other.b5) {
359                                             ::core::option::Option::Some(::core::cmp::Ordering::Equal)
360                                                 =>
361                                                 match ::core::cmp::PartialOrd::partial_cmp(&self.b6,
362                                                         &other.b6) {
363                                                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
364                                                         =>
365                                                         match ::core::cmp::PartialOrd::partial_cmp(&self.b7,
366                                                                 &other.b7) {
367                                                             ::core::option::Option::Some(::core::cmp::Ordering::Equal)
368                                                                 =>
369                                                                 ::core::cmp::PartialOrd::partial_cmp(&self.b8, &other.b8),
370                                                             cmp => cmp,
371                                                         },
372                                                     cmp => cmp,
373                                                 },
374                                             cmp => cmp,
375                                         },
376                                     cmp => cmp,
377                                 },
378                             cmp => cmp,
379                         },
380                     cmp => cmp,
381                 },
382             cmp => cmp,
383         }
384     }
385 }
386 #[automatically_derived]
387 impl ::core::cmp::Ord for Big {
388     #[inline]
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),
405                                                             cmp => cmp,
406                                                         },
407                                                     cmp => cmp,
408                                                 },
409                                             cmp => cmp,
410                                         },
411                                     cmp => cmp,
412                                 },
413                             cmp => cmp,
414                         },
415                     cmp => cmp,
416                 },
417             cmp => cmp,
418         }
419     }
420 }
421
422 // A struct that doesn't impl `Copy`, which means it gets the non-simple
423 // `clone` implemention that clones the fields individually.
424 struct NonCopy(u32);
425 #[automatically_derived]
426 impl ::core::clone::Clone for NonCopy {
427     #[inline]
428     fn clone(&self) -> NonCopy {
429         NonCopy(::core::clone::Clone::clone(&self.0))
430     }
431 }
432
433 // A packed struct that doesn't impl `Copy`, which means it gets the non-simple
434 // `clone` implemention that clones the fields individually.
435 #[repr(packed)]
436 struct PackedNonCopy(u32);
437 #[automatically_derived]
438 impl ::core::clone::Clone for PackedNonCopy {
439     #[inline]
440     fn clone(&self) -> PackedNonCopy {
441         PackedNonCopy(::core::clone::Clone::clone(&{ self.0 }))
442     }
443 }
444
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 {
450     #[inline]
451     fn clone(&self) -> ManualCopy {
452         ManualCopy(::core::clone::Clone::clone(&self.0))
453     }
454 }
455 impl Copy for ManualCopy {}
456
457 // A packed struct that impls `Copy` manually, which means it gets the
458 // non-simple `clone` implemention that clones the fields individually.
459 #[repr(packed)]
460 struct PackedManualCopy(u32);
461 #[automatically_derived]
462 impl ::core::clone::Clone for PackedManualCopy {
463     #[inline]
464     fn clone(&self) -> PackedManualCopy {
465         PackedManualCopy(::core::clone::Clone::clone(&{ self.0 }))
466     }
467 }
468 impl Copy for PackedManualCopy {}
469
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",
476             &&self.0)
477     }
478 }
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)
483     }
484 }
485 #[automatically_derived]
486 impl ::core::marker::StructuralPartialEq for Unsized { }
487 #[automatically_derived]
488 impl ::core::cmp::PartialEq for Unsized {
489     #[inline]
490     fn eq(&self, other: &Unsized) -> bool { self.0 == other.0 }
491 }
492 #[automatically_derived]
493 impl ::core::marker::StructuralEq for Unsized { }
494 #[automatically_derived]
495 impl ::core::cmp::Eq for Unsized {
496     #[inline]
497     #[doc(hidden)]
498     #[no_coverage]
499     fn assert_receiver_is_total_eq(&self) -> () {
500         let _: ::core::cmp::AssertParamIsEq<[u32]>;
501     }
502 }
503 #[automatically_derived]
504 impl ::core::cmp::PartialOrd for Unsized {
505     #[inline]
506     fn partial_cmp(&self, other: &Unsized)
507         -> ::core::option::Option<::core::cmp::Ordering> {
508         ::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
509     }
510 }
511 #[automatically_derived]
512 impl ::core::cmp::Ord for Unsized {
513     #[inline]
514     fn cmp(&self, other: &Unsized) -> ::core::cmp::Ordering {
515         ::core::cmp::Ord::cmp(&self.0, &other.0)
516     }
517 }
518
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.
521 #[repr(packed)]
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)
528     }
529 }
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)
534     }
535 }
536
537 trait Trait {
538     type A;
539 }
540
541 // A generic struct involving an associated type.
542 struct Generic<T: Trait, U> {
543     t: T,
544     ta: T::A,
545     u: U,
546 }
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 {
550     #[inline]
551     fn clone(&self) -> Generic<T, U> {
552         Generic {
553             t: ::core::clone::Clone::clone(&self.t),
554             ta: ::core::clone::Clone::clone(&self.ta),
555             u: ::core::clone::Clone::clone(&self.u),
556         }
557     }
558 }
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 {
562 }
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)
569     }
570 }
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 {
575     #[inline]
576     fn default() -> Generic<T, U> {
577         Generic {
578             t: ::core::default::Default::default(),
579             ta: ::core::default::Default::default(),
580             u: ::core::default::Default::default(),
581         }
582     }
583 }
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)
591     }
592 }
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 {
599     #[inline]
600     fn eq(&self, other: &Generic<T, U>) -> bool {
601         self.t == other.t && self.ta == other.ta && self.u == other.u
602     }
603 }
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 {
609     #[inline]
610     #[doc(hidden)]
611     #[no_coverage]
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>;
616     }
617 }
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 {
622     #[inline]
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,
628                         &other.ta) {
629                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
630                         => ::core::cmp::PartialOrd::partial_cmp(&self.u, &other.u),
631                     cmp => cmp,
632                 },
633             cmp => cmp,
634         }
635     }
636 }
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 {
640     #[inline]
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),
647                     cmp => cmp,
648                 },
649             cmp => cmp,
650         }
651     }
652 }
653
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.
659 #[repr(packed)]
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 {
666     #[inline]
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 }))
671     }
672 }
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 {
677 }
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
682     {
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 })
686     }
687 }
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 {
692     #[inline]
693     fn default() -> PackedGeneric<T, U> {
694         PackedGeneric(::core::default::Default::default(),
695             ::core::default::Default::default(),
696             ::core::default::Default::default())
697     }
698 }
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
703     {
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)
708     }
709 }
710 #[automatically_derived]
711 impl<T: Trait, U> ::core::marker::StructuralPartialEq for PackedGeneric<T, U>
712     {
713 }
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 {
719     #[inline]
720     fn eq(&self, other: &PackedGeneric<T, U>) -> bool {
721         ({ self.0 }) == ({ other.0 }) && ({ self.1 }) == ({ other.1 }) &&
722             ({ self.2 }) == ({ other.2 })
723     }
724 }
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 {
731     #[inline]
732     #[doc(hidden)]
733     #[no_coverage]
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>;
738     }
739 }
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 {
745     #[inline]
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 })
749             {
750             ::core::option::Option::Some(::core::cmp::Ordering::Equal) =>
751                 match ::core::cmp::PartialOrd::partial_cmp(&{ self.1 },
752                         &{ other.1 }) {
753                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
754                         =>
755                         ::core::cmp::PartialOrd::partial_cmp(&{ self.2 },
756                             &{ other.2 }),
757                     cmp => cmp,
758                 },
759             cmp => cmp,
760         }
761     }
762 }
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 {
767     #[inline]
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 }),
774                     cmp => cmp,
775                 },
776             cmp => cmp,
777         }
778     }
779 }
780
781 // An empty enum.
782 enum Enum0 {}
783 #[automatically_derived]
784 impl ::core::clone::Clone for Enum0 {
785     #[inline]
786     fn clone(&self) -> Enum0 { *self }
787 }
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() }
794     }
795 }
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() }
800     }
801 }
802 #[automatically_derived]
803 impl ::core::marker::StructuralPartialEq for Enum0 { }
804 #[automatically_derived]
805 impl ::core::cmp::PartialEq for Enum0 {
806     #[inline]
807     fn eq(&self, other: &Enum0) -> bool {
808         unsafe { ::core::intrinsics::unreachable() }
809     }
810 }
811 #[automatically_derived]
812 impl ::core::marker::StructuralEq for Enum0 { }
813 #[automatically_derived]
814 impl ::core::cmp::Eq for Enum0 {
815     #[inline]
816     #[doc(hidden)]
817     #[no_coverage]
818     fn assert_receiver_is_total_eq(&self) -> () {}
819 }
820 #[automatically_derived]
821 impl ::core::cmp::PartialOrd for Enum0 {
822     #[inline]
823     fn partial_cmp(&self, other: &Enum0)
824         -> ::core::option::Option<::core::cmp::Ordering> {
825         unsafe { ::core::intrinsics::unreachable() }
826     }
827 }
828 #[automatically_derived]
829 impl ::core::cmp::Ord for Enum0 {
830     #[inline]
831     fn cmp(&self, other: &Enum0) -> ::core::cmp::Ordering {
832         unsafe { ::core::intrinsics::unreachable() }
833     }
834 }
835
836 // A single-variant enum.
837 enum Enum1 {
838     Single {
839         x: u32,
840     },
841 }
842 #[automatically_derived]
843 impl ::core::clone::Clone for Enum1 {
844     #[inline]
845     fn clone(&self) -> Enum1 {
846         match self {
847             Enum1::Single { x: __self_0 } =>
848                 Enum1::Single { x: ::core::clone::Clone::clone(__self_0) },
849         }
850     }
851 }
852 #[automatically_derived]
853 impl ::core::fmt::Debug for Enum1 {
854     fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
855         match self {
856             Enum1::Single { x: __self_0 } =>
857                 ::core::fmt::Formatter::debug_struct_field1_finish(f,
858                     "Single", "x", &__self_0),
859         }
860     }
861 }
862 #[automatically_derived]
863 impl ::core::hash::Hash for Enum1 {
864     fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
865         match self {
866             Enum1::Single { x: __self_0 } =>
867                 ::core::hash::Hash::hash(__self_0, state),
868         }
869     }
870 }
871 #[automatically_derived]
872 impl ::core::marker::StructuralPartialEq for Enum1 { }
873 #[automatically_derived]
874 impl ::core::cmp::PartialEq for Enum1 {
875     #[inline]
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,
880         }
881     }
882 }
883 #[automatically_derived]
884 impl ::core::marker::StructuralEq for Enum1 { }
885 #[automatically_derived]
886 impl ::core::cmp::Eq for Enum1 {
887     #[inline]
888     #[doc(hidden)]
889     #[no_coverage]
890     fn assert_receiver_is_total_eq(&self) -> () {
891         let _: ::core::cmp::AssertParamIsEq<u32>;
892     }
893 }
894 #[automatically_derived]
895 impl ::core::cmp::PartialOrd for Enum1 {
896     #[inline]
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),
902         }
903     }
904 }
905 #[automatically_derived]
906 impl ::core::cmp::Ord for Enum1 {
907     #[inline]
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),
912         }
913     }
914 }
915
916 // A C-like, fieldless enum with a single variant.
917 enum Fieldless1 {
918
919     #[default]
920     A,
921 }
922 #[automatically_derived]
923 impl ::core::clone::Clone for Fieldless1 {
924     #[inline]
925     fn clone(&self) -> Fieldless1 { Fieldless1::A }
926 }
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")
931     }
932 }
933 #[automatically_derived]
934 impl ::core::default::Default for Fieldless1 {
935     #[inline]
936     fn default() -> Fieldless1 { Self::A }
937 }
938 #[automatically_derived]
939 impl ::core::hash::Hash for Fieldless1 {
940     fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
941 }
942 #[automatically_derived]
943 impl ::core::marker::StructuralPartialEq for Fieldless1 { }
944 #[automatically_derived]
945 impl ::core::cmp::PartialEq for Fieldless1 {
946     #[inline]
947     fn eq(&self, other: &Fieldless1) -> bool { true }
948 }
949 #[automatically_derived]
950 impl ::core::marker::StructuralEq for Fieldless1 { }
951 #[automatically_derived]
952 impl ::core::cmp::Eq for Fieldless1 {
953     #[inline]
954     #[doc(hidden)]
955     #[no_coverage]
956     fn assert_receiver_is_total_eq(&self) -> () {}
957 }
958 #[automatically_derived]
959 impl ::core::cmp::PartialOrd for Fieldless1 {
960     #[inline]
961     fn partial_cmp(&self, other: &Fieldless1)
962         -> ::core::option::Option<::core::cmp::Ordering> {
963         ::core::option::Option::Some(::core::cmp::Ordering::Equal)
964     }
965 }
966 #[automatically_derived]
967 impl ::core::cmp::Ord for Fieldless1 {
968     #[inline]
969     fn cmp(&self, other: &Fieldless1) -> ::core::cmp::Ordering {
970         ::core::cmp::Ordering::Equal
971     }
972 }
973
974 // A C-like, fieldless enum.
975 enum Fieldless {
976
977     #[default]
978     A,
979     B,
980     C,
981 }
982 #[automatically_derived]
983 impl ::core::clone::Clone for Fieldless {
984     #[inline]
985     fn clone(&self) -> Fieldless { *self }
986 }
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,
993             match self {
994                 Fieldless::A => "A",
995                 Fieldless::B => "B",
996                 Fieldless::C => "C",
997             })
998     }
999 }
1000 #[automatically_derived]
1001 impl ::core::default::Default for Fieldless {
1002     #[inline]
1003     fn default() -> Fieldless { Self::A }
1004 }
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)
1010     }
1011 }
1012 #[automatically_derived]
1013 impl ::core::marker::StructuralPartialEq for Fieldless { }
1014 #[automatically_derived]
1015 impl ::core::cmp::PartialEq for Fieldless {
1016     #[inline]
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
1021     }
1022 }
1023 #[automatically_derived]
1024 impl ::core::marker::StructuralEq for Fieldless { }
1025 #[automatically_derived]
1026 impl ::core::cmp::Eq for Fieldless {
1027     #[inline]
1028     #[doc(hidden)]
1029     #[no_coverage]
1030     fn assert_receiver_is_total_eq(&self) -> () {}
1031 }
1032 #[automatically_derived]
1033 impl ::core::cmp::PartialOrd for Fieldless {
1034     #[inline]
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)
1040     }
1041 }
1042 #[automatically_derived]
1043 impl ::core::cmp::Ord for Fieldless {
1044     #[inline]
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)
1049     }
1050 }
1051
1052 // An enum with multiple fieldless and fielded variants.
1053 enum Mixed {
1054
1055     #[default]
1056     P,
1057     Q,
1058     R(u32),
1059     S {
1060         d1: Option<u32>,
1061         d2: Option<i32>,
1062     },
1063 }
1064 #[automatically_derived]
1065 impl ::core::clone::Clone for Mixed {
1066     #[inline]
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>>;
1071         *self
1072     }
1073 }
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 {
1079         match self {
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",
1084                     &__self_0),
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),
1088         }
1089     }
1090 }
1091 #[automatically_derived]
1092 impl ::core::default::Default for Mixed {
1093     #[inline]
1094     fn default() -> Mixed { Self::P }
1095 }
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);
1101         match self {
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)
1106             }
1107             _ => {}
1108         }
1109     }
1110 }
1111 #[automatically_derived]
1112 impl ::core::marker::StructuralPartialEq for Mixed { }
1113 #[automatically_derived]
1114 impl ::core::cmp::PartialEq for Mixed {
1115     #[inline]
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,
1126                 _ => true,
1127             }
1128     }
1129 }
1130 #[automatically_derived]
1131 impl ::core::marker::StructuralEq for Mixed { }
1132 #[automatically_derived]
1133 impl ::core::cmp::Eq for Mixed {
1134     #[inline]
1135     #[doc(hidden)]
1136     #[no_coverage]
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>>;
1141     }
1142 }
1143 #[automatically_derived]
1144 impl ::core::cmp::PartialOrd for Mixed {
1145     #[inline]
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)
1156                     {
1157                     ::core::option::Option::Some(::core::cmp::Ordering::Equal)
1158                         => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
1159                     cmp => cmp,
1160                 },
1161             _ =>
1162                 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1163                     &__arg1_tag),
1164         }
1165     }
1166 }
1167 #[automatically_derived]
1168 impl ::core::cmp::Ord for Mixed {
1169     #[inline]
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),
1183                             cmp => cmp,
1184                         },
1185                     _ => ::core::cmp::Ordering::Equal,
1186                 },
1187             cmp => cmp,
1188         }
1189     }
1190 }
1191
1192 // An enum with no fieldless variants. Note that `Default` cannot be derived
1193 // for this enum.
1194 enum Fielded { X(u32), Y(bool), Z(Option<i32>), }
1195 #[automatically_derived]
1196 impl ::core::clone::Clone for Fielded {
1197     #[inline]
1198     fn clone(&self) -> Fielded {
1199         match self {
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)),
1206         }
1207     }
1208 }
1209 #[automatically_derived]
1210 impl ::core::fmt::Debug for Fielded {
1211     fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1212         match self {
1213             Fielded::X(__self_0) =>
1214                 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "X",
1215                     &__self_0),
1216             Fielded::Y(__self_0) =>
1217                 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Y",
1218                     &__self_0),
1219             Fielded::Z(__self_0) =>
1220                 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Z",
1221                     &__self_0),
1222         }
1223     }
1224 }
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);
1230         match self {
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),
1234         }
1235     }
1236 }
1237 #[automatically_derived]
1238 impl ::core::marker::StructuralPartialEq for Fielded { }
1239 #[automatically_derived]
1240 impl ::core::cmp::PartialEq for Fielded {
1241     #[inline]
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() }
1254             }
1255     }
1256 }
1257 #[automatically_derived]
1258 impl ::core::marker::StructuralEq for Fielded { }
1259 #[automatically_derived]
1260 impl ::core::cmp::Eq for Fielded {
1261     #[inline]
1262     #[doc(hidden)]
1263     #[no_coverage]
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>>;
1268     }
1269 }
1270 #[automatically_derived]
1271 impl ::core::cmp::PartialOrd for Fielded {
1272     #[inline]
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),
1284             _ =>
1285                 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1286                     &__arg1_tag),
1287         }
1288     }
1289 }
1290 #[automatically_derived]
1291 impl ::core::cmp::Ord for Fielded {
1292     #[inline]
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() }
1306                 },
1307             cmp => cmp,
1308         }
1309     }
1310 }
1311
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> {
1317     #[inline]
1318     fn clone(&self) -> EnumGeneric<T, U> {
1319         match self {
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)),
1324         }
1325     }
1326 }
1327 #[automatically_derived]
1328 impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
1329     for EnumGeneric<T, U> {
1330 }
1331 #[automatically_derived]
1332 impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
1333     EnumGeneric<T, U> {
1334     fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
1335         match self {
1336             EnumGeneric::One(__self_0) =>
1337                 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "One",
1338                     &__self_0),
1339             EnumGeneric::Two(__self_0) =>
1340                 ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Two",
1341                     &__self_0),
1342         }
1343     }
1344 }
1345 #[automatically_derived]
1346 impl<T: ::core::hash::Hash, U: ::core::hash::Hash> ::core::hash::Hash for
1347     EnumGeneric<T, U> {
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);
1351         match self {
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),
1356         }
1357     }
1358 }
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> {
1364     #[inline]
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() }
1375             }
1376     }
1377 }
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
1382     EnumGeneric<T, U> {
1383     #[inline]
1384     #[doc(hidden)]
1385     #[no_coverage]
1386     fn assert_receiver_is_total_eq(&self) -> () {
1387         let _: ::core::cmp::AssertParamIsEq<T>;
1388         let _: ::core::cmp::AssertParamIsEq<U>;
1389     }
1390 }
1391 #[automatically_derived]
1392 impl<T: ::core::cmp::PartialOrd, U: ::core::cmp::PartialOrd>
1393     ::core::cmp::PartialOrd for EnumGeneric<T, U> {
1394     #[inline]
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),
1404             _ =>
1405                 ::core::cmp::PartialOrd::partial_cmp(&__self_tag,
1406                     &__arg1_tag),
1407         }
1408     }
1409 }
1410 #[automatically_derived]
1411 impl<T: ::core::cmp::Ord, U: ::core::cmp::Ord> ::core::cmp::Ord for
1412     EnumGeneric<T, U> {
1413     #[inline]
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() }
1425                 },
1426             cmp => cmp,
1427         }
1428     }
1429 }
1430
1431 // A union. Most builtin traits are not derivable for unions.
1432 pub union Union {
1433     pub b: bool,
1434     pub u: u32,
1435     pub i: i32,
1436 }
1437 #[automatically_derived]
1438 impl ::core::clone::Clone for Union {
1439     #[inline]
1440     fn clone(&self) -> Union {
1441         let _: ::core::clone::AssertParamIsCopy<Self>;
1442         *self
1443     }
1444 }
1445 #[automatically_derived]
1446 impl ::core::marker::Copy for Union { }