@@ -36,26 +36,26 @@ pub(crate) trait Slot: Any + Send + Sync {
3636 /// # Safety condition
3737 ///
3838 /// The current revision MUST be the current revision of the database containing this slot.
39- unsafe fn memos ( & self , current_revision : Revision ) -> & MemoTable ;
39+ unsafe fn memos ( slot : * const Self , current_revision : Revision ) -> * const MemoTable ;
4040
4141 /// Mutably access the [`MemoTable`] for this slot.
4242 fn memos_mut ( & mut self ) -> & mut MemoTable ;
4343}
4444
4545/// [Slot::memos]
46- type SlotMemosFnRaw = unsafe fn ( * const ( ) , current_revision : Revision ) -> * const MemoTable ;
46+ type SlotMemosFnErased = unsafe fn ( * const ( ) , current_revision : Revision ) -> * const MemoTable ;
4747/// [Slot::memos]
48- type SlotMemosFn < T > = unsafe fn ( & T , current_revision : Revision ) -> & MemoTable ;
48+ type SlotMemosFn < T > = unsafe fn ( * const T , current_revision : Revision ) -> * const MemoTable ;
4949/// [Slot::memos_mut]
50- type SlotMemosMutFnRaw = unsafe fn ( * mut ( ) ) -> * mut MemoTable ;
50+ type SlotMemosMutFnErased = unsafe fn ( * mut ( ) ) -> * mut MemoTable ;
5151/// [Slot::memos_mut]
5252type SlotMemosMutFn < T > = fn ( & mut T ) -> & mut MemoTable ;
5353
5454struct SlotVTable {
5555 layout : Layout ,
5656 /// [`Slot`] methods
57- memos : SlotMemosFnRaw ,
58- memos_mut : SlotMemosMutFnRaw ,
57+ memos : SlotMemosFnErased ,
58+ memos_mut : SlotMemosMutFnErased ,
5959 /// A drop impl to call when the own page drops
6060 /// SAFETY: The caller is required to supply a correct data pointer to a `Box<PageDataEntry<T>>` and initialized length,
6161 /// and correct memo types.
@@ -78,10 +78,10 @@ impl SlotVTable {
7878 } ,
7979 layout : Layout :: new :: < T > ( ) ,
8080 // SAFETY: The signatures are compatible
81- memos : unsafe { mem:: transmute :: < SlotMemosFn < T > , SlotMemosFnRaw > ( T :: memos) } ,
81+ memos : unsafe { mem:: transmute :: < SlotMemosFn < T > , SlotMemosFnErased > ( T :: memos) } ,
8282 // SAFETY: The signatures are compatible
8383 memos_mut : unsafe {
84- mem:: transmute :: < SlotMemosMutFn < T > , SlotMemosMutFnRaw > ( T :: memos_mut)
84+ mem:: transmute :: < SlotMemosMutFn < T > , SlotMemosMutFnErased > ( T :: memos_mut)
8585 } ,
8686 }
8787 }
0 commit comments