diff --git a/crates/oxc_allocator/src/from_raw_parts.rs b/crates/oxc_allocator/src/from_raw_parts.rs index 3339a9f582e2c..aa6dd0e16654d 100644 --- a/crates/oxc_allocator/src/from_raw_parts.rs +++ b/crates/oxc_allocator/src/from_raw_parts.rs @@ -54,15 +54,15 @@ impl Allocator { /// /// # Panics /// - /// Panics if cannot determine layout of Bumpalo's `Bump` type. + /// Panics if cannot determine layout of Bumpalo's `Bump` type, or on a big endian system. /// /// [`RAW_MIN_ALIGN`]: Self::RAW_MIN_ALIGN /// [`RAW_MIN_SIZE`]: Self::RAW_MIN_SIZE pub unsafe fn from_raw_parts(ptr: NonNull, size: usize) -> Self { // Only support little-endian systems. // Calculating offset of `current_chunk_footer` on big-endian systems would be difficult. - #[cfg(target_endian = "big")] - const { + #[expect(clippy::manual_assert)] + if cfg!(target_endian = "big") { panic!("`Allocator::from_raw_parts` is not supported on big-endian systems."); }