Skip to content
Open
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
117 changes: 98 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions oscars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ hashbrown = "0.16.1"
oscars_derive = { path = "../oscars_derive", version = "0.1.0" }
rustc-hash = "2.1.1"
thin-vec = { version = "0.2", optional = true }
# Optional Trace/Finalize impls for external types.
icu_locale_core = { version = "2.2.0", default-features = false, optional = true }
either = { version = "1.16.0", optional = true }
arrayvec = { version = "0.7.6", optional = true }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down Expand Up @@ -39,3 +43,6 @@ mark_sweep_branded = ["mark_sweep"]
null_collector = ["mark_sweep"]
null_collector_branded = ["mark_sweep"]
thin-vec = ["dep:thin-vec", "mark_sweep"]
icu = ["dep:icu_locale_core", "mark_sweep"]
either = ["dep:either", "mark_sweep"]
arrayvec = ["dep:arrayvec", "mark_sweep"]
5 changes: 1 addition & 4 deletions oscars/src/alloc/mempool3/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,7 @@ impl<'pool, T: ?Sized> PoolPointer<'pool, T> {
self.0
}

pub fn to_erased(self) -> ErasedPoolPointer<'pool>
where
T: Sized,
{
pub fn to_erased(self) -> ErasedPoolPointer<'pool> {
ErasedPoolPointer(self.0.cast::<u8>(), PhantomData)
}

Expand Down
21 changes: 21 additions & 0 deletions oscars/src/collectors/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,24 @@ impl<T: Finalize> Finalize for OnceCell<T> {}
impl<T: ToOwned + Finalize + ?Sized> Finalize for Cow<'static, T> where T::Owned: Finalize {}

impl<T> Finalize for PhantomData<T> {}

#[cfg(feature = "icu")]
impl Finalize for icu_locale_core::LanguageIdentifier {}

#[cfg(feature = "icu")]
impl Finalize for icu_locale_core::Locale {}

#[cfg(feature = "either")]
impl<L: Finalize, R: Finalize> Finalize for either::Either<L, R> {}

#[cfg(feature = "arrayvec")]
impl<T: Finalize, const N: usize> Finalize for arrayvec::ArrayVec<T, N> {}

#[cfg(feature = "std")]
impl Finalize for std::path::Path {}
#[cfg(feature = "std")]
impl Finalize for std::path::PathBuf {}
#[cfg(feature = "std")]
impl Finalize for std::time::Instant {}
#[cfg(feature = "std")]
impl Finalize for std::time::SystemTime {}
Loading