File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 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 {
6969 }
7070
7171 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()`].
7273 Self ( unsafe { InnerTable :: from_pointer ( p) } )
7374 }
7475}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ impl<T> PointerWrapper for Box<T> {
5454 }
5555
5656 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()`].
5758 unsafe { Box :: from_raw ( ptr as _ ) }
5859 }
5960}
@@ -64,6 +65,7 @@ impl<T: RefCounted> PointerWrapper for Ref<T> {
6465 }
6566
6667 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()`].
6769 unsafe { Ref :: from_raw ( ptr as _ ) }
6870 }
6971}
@@ -74,6 +76,7 @@ impl<T> PointerWrapper for Arc<T> {
7476 }
7577
7678 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()`].
7780 unsafe { Arc :: from_raw ( ptr as _ ) }
7881 }
7982}
@@ -87,7 +90,8 @@ impl<T: PointerWrapper + Deref> PointerWrapper for Pin<T> {
8790 }
8891
8992 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()`.
9195 unsafe { Pin :: new_unchecked ( T :: from_pointer ( p) ) }
9296 }
9397}
You can’t perform that action at this time.
0 commit comments