@@ -422,65 +422,67 @@ impl ::core::cmp::Ord for Unsized {
422
422
}
423
423
}
424
424
425
- // A packed tuple struct.
425
+ // A packed tuple struct that impls `Copy` .
426
426
#[repr(packed)]
427
- struct Packed (u32);
427
+ struct PackedCopy (u32);
428
428
#[automatically_derived]
429
429
#[allow(unused_qualifications)]
430
- impl ::core::clone::Clone for Packed {
430
+ impl ::core::clone::Clone for PackedCopy {
431
431
#[inline]
432
- fn clone(&self) -> Packed {
432
+ fn clone(&self) -> PackedCopy {
433
433
let _: ::core::clone::AssertParamIsClone<u32>;
434
434
*self
435
435
}
436
436
}
437
437
#[automatically_derived]
438
438
#[allow(unused_qualifications)]
439
- impl ::core::marker::Copy for Packed { }
439
+ impl ::core::marker::Copy for PackedCopy { }
440
440
#[automatically_derived]
441
441
#[allow(unused_qualifications)]
442
- impl ::core::fmt::Debug for Packed {
442
+ impl ::core::fmt::Debug for PackedCopy {
443
443
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
444
444
let Self(__self_0_0) = *self;
445
- ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Packed ",
445
+ ::core::fmt::Formatter::debug_tuple_field1_finish(f, "PackedCopy ",
446
446
&&__self_0_0)
447
447
}
448
448
}
449
449
#[automatically_derived]
450
450
#[allow(unused_qualifications)]
451
- impl ::core::default::Default for Packed {
451
+ impl ::core::default::Default for PackedCopy {
452
452
#[inline]
453
- fn default() -> Packed { Packed(::core::default::Default::default()) }
453
+ fn default() -> PackedCopy {
454
+ PackedCopy(::core::default::Default::default())
455
+ }
454
456
}
455
457
#[automatically_derived]
456
458
#[allow(unused_qualifications)]
457
- impl ::core::hash::Hash for Packed {
459
+ impl ::core::hash::Hash for PackedCopy {
458
460
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
459
461
let Self(__self_0_0) = *self;
460
462
::core::hash::Hash::hash(&__self_0_0, state)
461
463
}
462
464
}
463
- impl ::core::marker::StructuralPartialEq for Packed {}
465
+ impl ::core::marker::StructuralPartialEq for PackedCopy {}
464
466
#[automatically_derived]
465
467
#[allow(unused_qualifications)]
466
- impl ::core::cmp::PartialEq for Packed {
468
+ impl ::core::cmp::PartialEq for PackedCopy {
467
469
#[inline]
468
- fn eq(&self, other: &Packed ) -> bool {
470
+ fn eq(&self, other: &PackedCopy ) -> bool {
469
471
let Self(__self_0_0) = *self;
470
472
let Self(__self_1_0) = *other;
471
473
__self_0_0 == __self_1_0
472
474
}
473
475
#[inline]
474
- fn ne(&self, other: &Packed ) -> bool {
476
+ fn ne(&self, other: &PackedCopy ) -> bool {
475
477
let Self(__self_0_0) = *self;
476
478
let Self(__self_1_0) = *other;
477
479
__self_0_0 != __self_1_0
478
480
}
479
481
}
480
- impl ::core::marker::StructuralEq for Packed {}
482
+ impl ::core::marker::StructuralEq for PackedCopy {}
481
483
#[automatically_derived]
482
484
#[allow(unused_qualifications)]
483
- impl ::core::cmp::Eq for Packed {
485
+ impl ::core::cmp::Eq for PackedCopy {
484
486
#[inline]
485
487
#[doc(hidden)]
486
488
#[no_coverage]
@@ -490,9 +492,9 @@ impl ::core::cmp::Eq for Packed {
490
492
}
491
493
#[automatically_derived]
492
494
#[allow(unused_qualifications)]
493
- impl ::core::cmp::PartialOrd for Packed {
495
+ impl ::core::cmp::PartialOrd for PackedCopy {
494
496
#[inline]
495
- fn partial_cmp(&self, other: &Packed )
497
+ fn partial_cmp(&self, other: &PackedCopy )
496
498
-> ::core::option::Option<::core::cmp::Ordering> {
497
499
let Self(__self_0_0) = *self;
498
500
let Self(__self_1_0) = *other;
@@ -501,15 +503,106 @@ impl ::core::cmp::PartialOrd for Packed {
501
503
}
502
504
#[automatically_derived]
503
505
#[allow(unused_qualifications)]
504
- impl ::core::cmp::Ord for Packed {
506
+ impl ::core::cmp::Ord for PackedCopy {
505
507
#[inline]
506
- fn cmp(&self, other: &Packed ) -> ::core::cmp::Ordering {
508
+ fn cmp(&self, other: &PackedCopy ) -> ::core::cmp::Ordering {
507
509
let Self(__self_0_0) = *self;
508
510
let Self(__self_1_0) = *other;
509
511
::core::cmp::Ord::cmp(&__self_0_0, &__self_1_0)
510
512
}
511
513
}
512
514
515
+ // A packed tuple struct that does not impl `Copy`. Note that the alignment of
516
+ // the field must be 1 for this code to be valid. Otherwise it triggers an
517
+ // error "`#[derive]` can't be used on a `#[repr(packed)]` struct that does not
518
+ // derive Copy (error E0133)" at MIR building time. This is a weird case and
519
+ // it's possible that this struct is not supposed to work, but for now it does.
520
+ #[repr(packed)]
521
+ struct PackedNonCopy(u8);
522
+ #[automatically_derived]
523
+ #[allow(unused_qualifications)]
524
+ impl ::core::clone::Clone for PackedNonCopy {
525
+ #[inline]
526
+ fn clone(&self) -> PackedNonCopy {
527
+ let Self(ref __self_0_0) = *self;
528
+ PackedNonCopy(::core::clone::Clone::clone(&*__self_0_0))
529
+ }
530
+ }
531
+ #[automatically_derived]
532
+ #[allow(unused_qualifications)]
533
+ impl ::core::fmt::Debug for PackedNonCopy {
534
+ fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
535
+ let Self(ref __self_0_0) = *self;
536
+ ::core::fmt::Formatter::debug_tuple_field1_finish(f, "PackedNonCopy",
537
+ &&*__self_0_0)
538
+ }
539
+ }
540
+ #[automatically_derived]
541
+ #[allow(unused_qualifications)]
542
+ impl ::core::default::Default for PackedNonCopy {
543
+ #[inline]
544
+ fn default() -> PackedNonCopy {
545
+ PackedNonCopy(::core::default::Default::default())
546
+ }
547
+ }
548
+ #[automatically_derived]
549
+ #[allow(unused_qualifications)]
550
+ impl ::core::hash::Hash for PackedNonCopy {
551
+ fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
552
+ let Self(ref __self_0_0) = *self;
553
+ ::core::hash::Hash::hash(&*__self_0_0, state)
554
+ }
555
+ }
556
+ impl ::core::marker::StructuralPartialEq for PackedNonCopy {}
557
+ #[automatically_derived]
558
+ #[allow(unused_qualifications)]
559
+ impl ::core::cmp::PartialEq for PackedNonCopy {
560
+ #[inline]
561
+ fn eq(&self, other: &PackedNonCopy) -> bool {
562
+ let Self(ref __self_0_0) = *self;
563
+ let Self(ref __self_1_0) = *other;
564
+ *__self_0_0 == *__self_1_0
565
+ }
566
+ #[inline]
567
+ fn ne(&self, other: &PackedNonCopy) -> bool {
568
+ let Self(ref __self_0_0) = *self;
569
+ let Self(ref __self_1_0) = *other;
570
+ *__self_0_0 != *__self_1_0
571
+ }
572
+ }
573
+ impl ::core::marker::StructuralEq for PackedNonCopy {}
574
+ #[automatically_derived]
575
+ #[allow(unused_qualifications)]
576
+ impl ::core::cmp::Eq for PackedNonCopy {
577
+ #[inline]
578
+ #[doc(hidden)]
579
+ #[no_coverage]
580
+ fn assert_receiver_is_total_eq(&self) -> () {
581
+ let _: ::core::cmp::AssertParamIsEq<u8>;
582
+ }
583
+ }
584
+ #[automatically_derived]
585
+ #[allow(unused_qualifications)]
586
+ impl ::core::cmp::PartialOrd for PackedNonCopy {
587
+ #[inline]
588
+ fn partial_cmp(&self, other: &PackedNonCopy)
589
+ -> ::core::option::Option<::core::cmp::Ordering> {
590
+ let Self(ref __self_0_0) = *self;
591
+ let Self(ref __self_1_0) = *other;
592
+ ::core::cmp::PartialOrd::partial_cmp(&*__self_0_0, &*__self_1_0)
593
+ }
594
+ }
595
+ #[automatically_derived]
596
+ #[allow(unused_qualifications)]
597
+ impl ::core::cmp::Ord for PackedNonCopy {
598
+ #[inline]
599
+ fn cmp(&self, other: &PackedNonCopy) -> ::core::cmp::Ordering {
600
+ let Self(ref __self_0_0) = *self;
601
+ let Self(ref __self_1_0) = *other;
602
+ ::core::cmp::Ord::cmp(&*__self_0_0, &*__self_1_0)
603
+ }
604
+ }
605
+
513
606
// An empty enum.
514
607
enum Enum0 {}
515
608
#[automatically_derived]
0 commit comments