@@ -136,7 +136,11 @@ impl ::core::cmp::PartialEq for Point {
136136 #[inline]
137137 fn eq(&self, other: &Point) -> bool {
138138 if ::core::intrinsics::can_compare_bitwise::<Self>() {
139- ::core::intrinsics::compare_bitwise(self, other)
139+ (unsafe {
140+ ::core::intrinsics::compare_bytes(self as *const Self as
141+ *const u8, other as *const Self as *const u8,
142+ ::core::intrinsics::size_of_val(self))
143+ }) == 0i32
140144 } else { self.x == other.x && self.y == other.y }
141145 }
142146}
@@ -226,7 +230,11 @@ impl ::core::cmp::PartialEq for PackedPoint {
226230 #[inline]
227231 fn eq(&self, other: &PackedPoint) -> bool {
228232 if ::core::intrinsics::can_compare_bitwise::<Self>() {
229- ::core::intrinsics::compare_bitwise(self, other)
233+ (unsafe {
234+ ::core::intrinsics::compare_bytes(self as *const Self as
235+ *const u8, other as *const Self as *const u8,
236+ ::core::intrinsics::size_of_val(self))
237+ }) == 0i32
230238 } else {
231239 ({ self.x }) == ({ other.x }) && ({ self.y }) == ({ other.y })
232240 }
@@ -490,7 +498,11 @@ impl ::core::cmp::PartialEq for Big {
490498 #[inline]
491499 fn eq(&self, other: &Big) -> bool {
492500 if ::core::intrinsics::can_compare_bitwise::<Self>() {
493- ::core::intrinsics::compare_bitwise(self, other)
501+ (unsafe {
502+ ::core::intrinsics::compare_bytes(self as *const Self as
503+ *const u8, other as *const Self as *const u8,
504+ ::core::intrinsics::size_of_val(self))
505+ }) == 0i32
494506 } else {
495507 self.b1 == other.b1 && self.b2 == other.b2 && self.b3 == other.b3
496508 && self.b4 == other.b4 && self.b5 == other.b5 &&
@@ -613,7 +625,11 @@ impl ::core::cmp::PartialEq for Reorder {
613625 #[inline]
614626 fn eq(&self, other: &Reorder) -> bool {
615627 if ::core::intrinsics::can_compare_bitwise::<Self>() {
616- ::core::intrinsics::compare_bitwise(self, other)
628+ (unsafe {
629+ ::core::intrinsics::compare_bytes(self as *const Self as
630+ *const u8, other as *const Self as *const u8,
631+ ::core::intrinsics::size_of_val(self))
632+ }) == 0i32
617633 } else {
618634 self.b2 == other.b2 && self.b4 == other.b4 && self.b5 == other.b5
619635 && self.b6 == other.b6 && self.b7 == other.b7 &&
@@ -859,7 +875,11 @@ impl<T: ::core::cmp::PartialEq + Trait, U: ::core::cmp::PartialEq>
859875 #[inline]
860876 fn eq(&self, other: &Generic<T, U>) -> bool {
861877 if ::core::intrinsics::can_compare_bitwise::<Self>() {
862- ::core::intrinsics::compare_bitwise(self, other)
878+ (unsafe {
879+ ::core::intrinsics::compare_bytes(self as *const Self as
880+ *const u8, other as *const Self as *const u8,
881+ ::core::intrinsics::size_of_val(self))
882+ }) == 0i32
863883 } else {
864884 self.t == other.t && self.ta == other.ta && self.u == other.u
865885 }
@@ -983,7 +1003,11 @@ impl<T: ::core::cmp::PartialEq + ::core::marker::Copy + Trait,
9831003 #[inline]
9841004 fn eq(&self, other: &PackedGeneric<T, U>) -> bool {
9851005 if ::core::intrinsics::can_compare_bitwise::<Self>() {
986- ::core::intrinsics::compare_bitwise(self, other)
1006+ (unsafe {
1007+ ::core::intrinsics::compare_bytes(self as *const Self as
1008+ *const u8, other as *const Self as *const u8,
1009+ ::core::intrinsics::size_of_val(self))
1010+ }) == 0i32
9871011 } else {
9881012 ({ self.0 }) == ({ other.0 }) && ({ self.1 }) == ({ other.1 }) &&
9891013 ({ self.2 }) == ({ other.2 })
0 commit comments