diff --git a/src/fixed_bump_vec.rs b/src/fixed_bump_vec.rs index e336496..166ccca 100644 --- a/src/fixed_bump_vec.rs +++ b/src/fixed_bump_vec.rs @@ -1273,7 +1273,7 @@ impl<'a, T> FixedBumpVec<'a, T> { } #[inline(always)] - fn from_raw_parts(initialized: BumpBox<'a, [T]>, capacity: usize) -> Self { + unsafe fn from_raw_parts(initialized: BumpBox<'a, [T]>, capacity: usize) -> Self { Self { initialized, capacity } } diff --git a/src/polyfill/nonnull.rs b/src/polyfill/nonnull.rs index e319709..e5e5fb3 100644 --- a/src/polyfill/nonnull.rs +++ b/src/polyfill/nonnull.rs @@ -269,16 +269,6 @@ pub(crate) unsafe fn truncate(slice: &mut NonNull<[T]>, len: usize) { drop_in_place(to_drop); } -#[allow(unused_macros)] -macro_rules! addr_of { - ($ptr:ident.$member:ident) => {{ - NonNull::new_unchecked(core::ptr::addr_of_mut!((*$ptr.as_ptr()).$member)) - }}; -} - -#[allow(unused_imports)] -pub(crate) use addr_of; - /// like ` as From<&T>>::from` but `const` pub(crate) const fn from_ref(r: &T) -> NonNull { unsafe { NonNull::new_unchecked(r as *const T as *mut T) }