Skip to content

Commit

Permalink
refactor(allocator): make Box::new_in code more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jul 23, 2024
1 parent e4a0264 commit b81c84d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_allocator/src/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'alloc, T> Box<'alloc, T> {

impl<'alloc, T> Box<'alloc, T> {
pub fn new_in(value: T, allocator: &Allocator) -> Self {
Self(allocator.alloc(value).into(), PhantomData)
Self(NonNull::from(allocator.alloc(value)), PhantomData)
}

/// Create a fake `Box` with a dangling pointer.
Expand Down

0 comments on commit b81c84d

Please sign in to comment.