Skip to content

Commit

Permalink
Fix size check macro
Browse files Browse the repository at this point in the history
It was using the wrong `target_arch`. Found using the new cfg checks that have appeared in Rust 1.80.
  • Loading branch information
Kobzol committed Aug 1, 2024
1 parent 8cfa3df commit 91ddb55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ pub enum EventPayload {
}

// Keep the size of the event structure in check
static_assert_size!(EventPayload, 136);
static_assert_size!(EventPayload, 176);
2 changes: 1 addition & 1 deletion crates/tako/src/internal/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::hash::Hash;
#[macro_export]
macro_rules! static_assert_size {
($ty:ty, $size:expr) => {
#[cfg(target_arch = "x86_x64")]
#[cfg(target_arch = "x86_64")]
const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];
};
}
Expand Down
2 changes: 1 addition & 1 deletion crates/tako/src/internal/server/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub struct Task {
}

// Task is a critical data structure, so we should keep its size in check
static_assert_size!(Task, 168);
static_assert_size!(Task, 112);

impl fmt::Debug for Task {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down

0 comments on commit 91ddb55

Please sign in to comment.