Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
tgross35 committed Nov 2, 2025
commit 0607c0969bdfcc43ec1e5434e0e169baf388b908
8 changes: 4 additions & 4 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ macro_rules! s {
(it: $(#[$attr:meta])* $pub:vis struct $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(Eq, Hash, PartialEq)
)]
#[::core::prelude::v1::derive(
::core::clone::Clone,
::core::marker::Copy,
::core::fmt::Debug,
)]
#[cfg_attr(
feature = "extra_traits",
::core::prelude::v1::derive(Eq, Hash, PartialEq)
)]
#[allow(deprecated)]
$(#[$attr])*
$pub struct $i { $($field)* }
Expand Down
Loading