Skip to content

Commit

Permalink
Fix alignment of Parsed test (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 18, 2024
1 parent 9a4480f commit 4f77df1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ use time::{
#[test]
fn alignment() {
macro_rules! assert_alignment {
($t:ty, $alignment:literal) => {
($t:ty, $alignment:expr) => {
let alignment = $alignment;
assert_eq!(
::core::mem::align_of::<$t>(),
$alignment,
concat!("alignment of `{}` was ", $alignment),
alignment,
"alignment of `{}` was {}",
stringify!($t),
alignment,
);
};
}
Expand Down Expand Up @@ -71,10 +73,7 @@ fn alignment() {
assert_alignment!(iso8601::FormattedComponents, 1);
assert_alignment!(iso8601::OffsetPrecision, 1);
assert_alignment!(iso8601::TimePrecision, 1);
#[cfg(miri)]
assert_alignment!(Parsed, 16);
#[cfg(not(miri))]
assert_alignment!(Parsed, 8);
assert_alignment!(Parsed, ::core::mem::align_of::<u128>());
assert_alignment!(Month, 1);
assert_alignment!(Weekday, 1);
assert_alignment!(Error, 8);
Expand Down

0 comments on commit 4f77df1

Please sign in to comment.