From 16dcdaf6cdc03a89ee9e06240a373b3c9f1c1992 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Tue, 7 Jan 2025 06:58:23 +0000 Subject: [PATCH] test(lexer): assert size of `Token` in 32-bit WASM (#8292) `Token` should be 16 bytes in WASM too. Enable this test on 32-bit platforms. --- crates/oxc_parser/src/lexer/token.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/oxc_parser/src/lexer/token.rs b/crates/oxc_parser/src/lexer/token.rs index cabdf2b4e51eb..63e3a774b6e6c 100644 --- a/crates/oxc_parser/src/lexer/token.rs +++ b/crates/oxc_parser/src/lexer/token.rs @@ -39,11 +39,6 @@ pub struct Token { _padding2: u32, } -#[cfg(all(test, target_pointer_width = "64"))] -mod size_asserts { - const _: () = assert!(std::mem::size_of::() == 16); -} - impl Token { pub(super) fn new_on_new_line() -> Self { Self { is_on_new_line: true, ..Self::default() } @@ -68,3 +63,9 @@ impl Token { self.has_separator = true; } } + +#[cfg(test)] +mod size_asserts { + use super::Token; + const _: () = assert!(std::mem::size_of::() == 16); +}