use crate::{
BaseAllocator, Bump, BumpScope, WithoutDealloc, WithoutShrink,
settings::BumpAllocatorSettings,
traits::{BumpAllocatorCore, assert_dyn_compatible, assert_implements},
};
pub unsafe trait BumpAllocatorCoreScope<'a>: BumpAllocatorCore {}
assert_dyn_compatible!(BumpAllocatorCoreScope<'_>);
assert_implements! {
[BumpAllocatorCoreScope<'a> + ?Sized]
BumpScope
&Bump
&BumpScope
&mut Bump
&mut BumpScope
dyn BumpAllocatorCoreScope
&dyn BumpAllocatorCoreScope
&mut dyn BumpAllocatorCoreScope
dyn MutBumpAllocatorCoreScope
&dyn MutBumpAllocatorCoreScope
&mut dyn MutBumpAllocatorCoreScope
}
unsafe impl<'a, B: BumpAllocatorCoreScope<'a> + ?Sized> BumpAllocatorCoreScope<'a> for &B {}
unsafe impl<'a, B: BumpAllocatorCoreScope<'a> + ?Sized> BumpAllocatorCoreScope<'a> for &mut B {}
unsafe impl<'a, B: BumpAllocatorCoreScope<'a>> BumpAllocatorCoreScope<'a> for WithoutDealloc<B> {}
unsafe impl<'a, B: BumpAllocatorCoreScope<'a>> BumpAllocatorCoreScope<'a> for WithoutShrink<B> {}
unsafe impl<'a, A, S> BumpAllocatorCoreScope<'a> for BumpScope<'a, A, S>
where
A: BaseAllocator<S::GuaranteedAllocated>,
S: BumpAllocatorSettings,
{
}
unsafe impl<'a, A, S> BumpAllocatorCoreScope<'a> for &'a Bump<A, S>
where
A: BaseAllocator<S::GuaranteedAllocated>,
S: BumpAllocatorSettings,
{
}
unsafe impl<'a, A, S> BumpAllocatorCoreScope<'a> for &'a mut Bump<A, S>
where
A: BaseAllocator<S::GuaranteedAllocated>,
S: BumpAllocatorSettings,
{
}