Skip to content

Commit b85a04f

Browse files
committed
chore: update allocator-api2 to 0.3.1
1 parent 783f68f commit b85a04f

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ default-target = "x86_64-unknown-linux-gnu"
3737
targets = []
3838

3939
[dependencies]
40-
allocator-api2 = { version = "0.2.21", default-features = false }
40+
allocator-api2 = { version = "0.3.1", default-features = false }
4141
async-task = { version = "4.7.1", optional = true }
4242
lock_api = "0.4.13"
4343
nginx-sys = { path = "nginx-sys", version = "0.5.0-beta"}

src/allocator.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use ::core::ptr::{self, NonNull};
1414
pub use allocator_api2::alloc::{AllocError, Allocator};
1515

1616
#[cfg(feature = "alloc")]
17-
pub use allocator_api2::{alloc::Global, boxed::Box};
17+
pub use allocator_api2::{alloc::Global, boxed::Box, unsize_box};
1818

1919
/// Explicitly duplicate an object using the specified Allocator.
2020
pub trait TryCloneIn: Sized {
@@ -81,24 +81,3 @@ mod impls {
8181
}
8282
}
8383
}
84-
85-
/// Allows turning a [`Box<T: Sized, A>`][Box] into a [`Box<U: ?Sized, A>`][Box] where `T` can be
86-
/// unsizing-coerced into a `U`.
87-
///
88-
/// See [allocator_api2::unsize_box] for an explanation why this macro is necessary.
89-
#[cfg(feature = "alloc")]
90-
#[doc(inline)]
91-
pub use crate::__unsize_box as unsize_box;
92-
93-
// We have to reimplement this macro because the original implementation is not reexportable.
94-
// Macro definitions float to the top of the crate, thus we also mark it as hidden and reexport
95-
// again from the right namespace.
96-
#[cfg(feature = "alloc")]
97-
#[doc(hidden)]
98-
#[macro_export]
99-
macro_rules! __unsize_box {
100-
( $boxed:expr $(,)? ) => {{
101-
let (ptr, alloc) = $crate::allocator::Box::into_raw_with_allocator($boxed);
102-
unsafe { $crate::allocator::Box::from_raw_in(ptr as *mut _, alloc) }
103-
}};
104-
}

0 commit comments

Comments
 (0)