diff --git a/crates/oxc_allocator/src/vec2/raw_vec.rs b/crates/oxc_allocator/src/vec2/raw_vec.rs index fe0d8f1524b12..a5c436c74db4f 100644 --- a/crates/oxc_allocator/src/vec2/raw_vec.rs +++ b/crates/oxc_allocator/src/vec2/raw_vec.rs @@ -28,7 +28,6 @@ use core::cmp; use core::mem; use core::ptr::{self, NonNull}; -use allocator_api2::alloc::AllocError; use bumpalo::collections::CollectionAllocErr::{self, AllocErr, CapacityOverflow}; use crate::alloc::Alloc; @@ -791,13 +790,6 @@ fn capacity_overflow() -> ! { panic!("capacity overflow") } -// Copied from https://github.com/fitzgen/bumpalo/blob/1d2fbea9e3d0c2be56367b9ad5382ff33852a188/src/lib.rs#L482-L486 -/// Wrapper around `Layout::from_size_align` that adds debug assertions. -#[inline] -fn layout_from_size_align(size: usize, align: usize) -> Result { - Layout::from_size_align(size, align).map_err(|_| AllocError) -} - /// Handle collection allocation errors /// // Causing a collection alloc error is rare case, so marked as `#[cold]` and `#[inline(never)]`