Skip to content

Commit 5e113a3

Browse files
committed
Flip Copy and PartialEq, Hash derives for packed struct support
1.63 doesn't support deriving `PartialEq` on non-`Copy` packed structs and will error out here because it doesn't realize `Copy` is added later. Swapping the order of the derives resolves this issue and enables us to derive `extra_traits` even on packed structs. (backport <#4807>) (cherry picked from commit 79d1bdb)
1 parent 0e379dc commit 5e113a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ macro_rules! s {
154154
(it: $(#[$attr:meta])* $pub:vis struct $i:ident { $($field:tt)* }) => (
155155
__item! {
156156
#[repr(C)]
157-
#[cfg_attr(
158-
feature = "extra_traits",
159-
::core::prelude::v1::derive(Eq, Hash, PartialEq)
160-
)]
161157
#[::core::prelude::v1::derive(
162158
::core::clone::Clone,
163159
::core::marker::Copy,
164160
::core::fmt::Debug,
165161
)]
162+
#[cfg_attr(
163+
feature = "extra_traits",
164+
::core::prelude::v1::derive(Eq, Hash, PartialEq)
165+
)]
166166
#[allow(deprecated)]
167167
$(#[$attr])*
168168
$pub struct $i { $($field)* }

0 commit comments

Comments
 (0)