Skip to content

Commit

Permalink
fix derive macro for zeroable
Browse files Browse the repository at this point in the history
  • Loading branch information
y86-dev committed Jul 24, 2023
1 parent 8b23e2a commit b8922fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,8 +1364,15 @@ macro_rules! __derive_zeroable {
#[automatically_derived]
unsafe impl<$($impl_generics)*> $crate::Zeroable for $name<$($ty_generics)*>
where
$($field_ty: $crate::Zeroable,)*
$($($whr)*)?
{}
const _: () = {
fn assert_zeroable<T: $crate::Zeroable + ?::core::marker::Sized>() {}
fn ensure_zeroable<$($impl_generics)*>()
where $($($whr)*)?
{
$(assert_zeroable::<$field_ty>();)*
}
};
};
}

0 comments on commit b8922fd

Please sign in to comment.