@@ -36,26 +36,26 @@ pub(crate) trait Slot: Any + Send + Sync {
36
36
/// # Safety condition
37
37
///
38
38
/// 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 ;
40
40
41
41
/// Mutably access the [`MemoTable`] for this slot.
42
42
fn memos_mut ( & mut self ) -> & mut MemoTable ;
43
43
}
44
44
45
45
/// [Slot::memos]
46
- type SlotMemosFnRaw = unsafe fn ( * const ( ) , current_revision : Revision ) -> * const MemoTable ;
46
+ type SlotMemosFnErased = unsafe fn ( * const ( ) , current_revision : Revision ) -> * const MemoTable ;
47
47
/// [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 ;
49
49
/// [Slot::memos_mut]
50
- type SlotMemosMutFnRaw = unsafe fn ( * mut ( ) ) -> * mut MemoTable ;
50
+ type SlotMemosMutFnErased = unsafe fn ( * mut ( ) ) -> * mut MemoTable ;
51
51
/// [Slot::memos_mut]
52
52
type SlotMemosMutFn < T > = fn ( & mut T ) -> & mut MemoTable ;
53
53
54
54
struct SlotVTable {
55
55
layout : Layout ,
56
56
/// [`Slot`] methods
57
- memos : SlotMemosFnRaw ,
58
- memos_mut : SlotMemosMutFnRaw ,
57
+ memos : SlotMemosFnErased ,
58
+ memos_mut : SlotMemosMutFnErased ,
59
59
/// A drop impl to call when the own page drops
60
60
/// SAFETY: The caller is required to supply a correct data pointer to a `Box<PageDataEntry<T>>` and initialized length,
61
61
/// and correct memo types.
@@ -78,10 +78,10 @@ impl SlotVTable {
78
78
} ,
79
79
layout : Layout :: new :: < T > ( ) ,
80
80
// 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) } ,
82
82
// SAFETY: The signatures are compatible
83
83
memos_mut : unsafe {
84
- mem:: transmute :: < SlotMemosMutFn < T > , SlotMemosMutFnRaw > ( T :: memos_mut)
84
+ mem:: transmute :: < SlotMemosMutFn < T > , SlotMemosMutFnErased > ( T :: memos_mut)
85
85
} ,
86
86
}
87
87
}
0 commit comments