File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ impl PointerWrapper for OfMatchTable {
69
69
}
70
70
71
71
unsafe fn from_pointer ( p : * const c_types:: c_void ) -> Self {
72
+ // SAFETY: The passed pointer comes from a previous call to [`InnerTable::into_pointer()`].
72
73
Self ( unsafe { InnerTable :: from_pointer ( p) } )
73
74
}
74
75
}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ impl<T> PointerWrapper for Box<T> {
54
54
}
55
55
56
56
unsafe fn from_pointer ( ptr : * const c_types:: c_void ) -> Self {
57
+ // SAFETY: The passed pointer comes from a previous call to [`Self::into_pointer()`].
57
58
unsafe { Box :: from_raw ( ptr as _ ) }
58
59
}
59
60
}
@@ -64,6 +65,7 @@ impl<T: RefCounted> PointerWrapper for Ref<T> {
64
65
}
65
66
66
67
unsafe fn from_pointer ( ptr : * const c_types:: c_void ) -> Self {
68
+ // SAFETY: The passed pointer comes from a previous call to [`Self::into_pointer()`].
67
69
unsafe { Ref :: from_raw ( ptr as _ ) }
68
70
}
69
71
}
@@ -74,6 +76,7 @@ impl<T> PointerWrapper for Arc<T> {
74
76
}
75
77
76
78
unsafe fn from_pointer ( ptr : * const c_types:: c_void ) -> Self {
79
+ // SAFETY: The passed pointer comes from a previous call to [`Self::into_pointer()`].
77
80
unsafe { Arc :: from_raw ( ptr as _ ) }
78
81
}
79
82
}
@@ -87,7 +90,8 @@ impl<T: PointerWrapper + Deref> PointerWrapper for Pin<T> {
87
90
}
88
91
89
92
unsafe fn from_pointer ( p : * const c_types:: c_void ) -> Self {
90
- // TODO: Review: SAFETY: The object was originally pinned.
93
+ // SAFETY: The object was originally pinned.
94
+ // The passed pointer comes from a previous call to `inner::into_pointer()`.
91
95
unsafe { Pin :: new_unchecked ( T :: from_pointer ( p) ) }
92
96
}
93
97
}
You can’t perform that action at this time.
0 commit comments