add associated Payload type to ArenaAllocated
This commit is contained in:
10
src/types.rs
10
src/types.rs
@@ -300,7 +300,10 @@ impl fmt::Debug for HeapCellValue {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ArenaAllocated> From<TypedArenaPtr<T>> for HeapCellValue {
|
||||
impl<T: ArenaAllocated> From<TypedArenaPtr<T>> for HeapCellValue
|
||||
where
|
||||
T::Payload: Sized,
|
||||
{
|
||||
#[inline]
|
||||
fn from(arena_ptr: TypedArenaPtr<T>) -> HeapCellValue {
|
||||
HeapCellValue::from(arena_ptr.header_ptr() as u64)
|
||||
@@ -708,7 +711,10 @@ impl UntypedArenaPtr {
|
||||
/// # Safety
|
||||
/// - this UntypedArenaPtr actuall pointee type is T
|
||||
#[inline]
|
||||
pub unsafe fn as_typed_ptr<T: ArenaAllocated>(self) -> TypedArenaPtr<T> {
|
||||
pub unsafe fn as_typed_ptr<T: ?Sized + ArenaAllocated>(self) -> TypedArenaPtr<T>
|
||||
where
|
||||
T::Payload: Sized,
|
||||
{
|
||||
T::typed_ptr(self)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user