Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(data_structures): remove NonNull shim #8423

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/oxc_data_structures/src/stack/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
use std::{
alloc::{self, Layout},
mem::{align_of, size_of},
ptr, slice,
ptr::{self, NonNull},
slice,
};

use assert_unchecked::assert_unchecked;

use super::{NonNull, StackCapacity};
use super::StackCapacity;

pub trait StackCommon<T>: StackCapacity<T> {
// Getter + setter methods defined by implementer
Expand Down
2 changes: 0 additions & 2 deletions crates/oxc_data_structures/src/stack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
mod capacity;
mod common;
mod non_empty;
mod non_null;
mod sparse;
mod standard;

use capacity::StackCapacity;
use common::StackCommon;
pub use non_empty::NonEmptyStack;
use non_null::NonNull;
pub use sparse::SparseStack;
pub use standard::Stack;
3 changes: 2 additions & 1 deletion crates/oxc_data_structures/src/stack/non_empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use std::{
mem::size_of,
ops::{Deref, DerefMut},
ptr::NonNull,
};

use super::{NonNull, StackCapacity, StackCommon};
use super::{StackCapacity, StackCommon};

/// A stack which can never be empty.
///
Expand Down
109 changes: 0 additions & 109 deletions crates/oxc_data_structures/src/stack/non_null.rs

This file was deleted.

3 changes: 2 additions & 1 deletion crates/oxc_data_structures/src/stack/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use std::{
mem::size_of,
ops::{Deref, DerefMut},
ptr::NonNull,
};

use super::{NonNull, StackCapacity, StackCommon};
use super::{StackCapacity, StackCommon};

/// A simple stack.
///
Expand Down
Loading