From bdbeaeb44bbe1a0abda99c874d73802cdfcacbc1 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sat, 7 Mar 2026 11:20:44 +0100 Subject: [PATCH] Update allocator_api2 dependency --- Cargo.toml | 6 +++--- src/lib.rs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 02a5832..e29247b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ description = "Reference counted vector data structure." [dev-dependencies] criterion = "0.4" -blink-alloc = "0.2.5" +blink-alloc = "0.4.0" [[bench]] name = "vector" @@ -21,9 +21,9 @@ harness = false debug = true [dependencies] -allocator-api2 = "0.2.4" +allocator-api2 = "0.4.0" [features] default = ["std"] -nightly = ["allocator-api2/nightly", "blink-alloc/nightly"] +nightly = ["blink-alloc/nightly"] std = ["allocator-api2/std"] diff --git a/src/lib.rs b/src/lib.rs index 243a1be..6f9c734 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,10 @@ pub use shared::{AtomicSharedVector, RefCountedVector, SharedVector}; pub use vector::{Vector, RawVector}; pub mod alloc { + #[cfg(not(feature = "nightly"))] pub use allocator_api2::alloc::{AllocError, Allocator, Global}; + #[cfg(feature = "nightly")] + pub use std::alloc::{AllocError, Allocator, Global}; } pub(crate) fn grow_amortized(len: usize, additional: usize) -> usize { @@ -111,7 +114,7 @@ macro_rules! arc_vector { #[test] fn vector_macro() { - pub use allocator_api2::alloc::Global; + pub use crate::alloc::Global; let v1: Vector = vector![0, 1, 2, 3, 4, 5]; let v2: Vector = vector![2; 4];