From 9a079088cee5879a68a08631fb0441e00fbea245 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Tue, 3 Dec 2024 12:00:50 -0800 Subject: [PATCH] Update `Safety` doc on `Image::from_ptr` to mention mutability --- pixman/src/image/bits.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pixman/src/image/bits.rs b/pixman/src/image/bits.rs index 1ddf77d..a7856e2 100644 --- a/pixman/src/image/bits.rs +++ b/pixman/src/image/bits.rs @@ -491,6 +491,9 @@ impl<'bits, 'alpha> Image<'bits, 'alpha> { /// /// The pointer is expected to be valid and have a ref-count of at least one. /// Ownership of the pointer is transferred and unref will be called on drop. + /// + /// Any other references to the `pixman_image_t` must not be mutated while this + /// `Image` exists, including changes to the reference count. pub unsafe fn from_ptr(ptr: *mut ffi::pixman_image_t) -> Self { Self { image: unsafe { ImageRef::from_ptr(ptr) },