fix: Mark all pointer manipulation as unsafe

See b43455fdd0468f067741a79a7031ba2fa907f0eb for rationale

(cherry picked from commit b9996c6ddd3973cd419930210bf11a4d1bc6350b)
This commit is contained in:
Robert Hensing 2024-12-17 10:40:03 +01:00
parent c986c09b8c
commit d19dd45bbf
3 changed files with 43 additions and 19 deletions

View file

@ -24,7 +24,10 @@ struct StoreRef {
inner: NonNull<raw::Store>,
}
impl StoreRef {
pub fn ptr(&self) -> *mut raw::Store {
/// # Safety
///
/// The returned pointer is only valid as long as the `StoreRef` is alive.
pub unsafe fn ptr(&self) -> *mut raw::Store {
self.inner.as_ptr()
}
}
@ -157,7 +160,10 @@ impl Store {
Ok(store)
}
pub fn raw_ptr(&self) -> *mut raw::Store {
/// # Safety
///
/// The returned pointer is only valid as long as the `Store` is alive.
pub unsafe fn raw_ptr(&self) -> *mut raw::Store {
self.inner.ptr()
}