Signed-off-by: Bernhard Beschow <shen...@gmail.com> --- rust/qemu-api/src/cell.rs | 2 +- rust/qemu-api/src/qom.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/qemu-api/src/cell.rs b/rust/qemu-api/src/cell.rs index 27063b049d..851573f8ef 100644 --- a/rust/qemu-api/src/cell.rs +++ b/rust/qemu-api/src/cell.rs @@ -965,7 +965,7 @@ impl<T> Opaque<T> { /// # Safety /// /// The pointer must be valid, though it need not point to a valid value. - pub unsafe fn from_raw<'a>(ptr: *mut T) -> &'a Self { + pub const unsafe fn from_raw<'a>(ptr: *mut T) -> &'a Self { let ptr = NonNull::new(ptr).unwrap().cast::<Self>(); // SAFETY: Self is a transparent wrapper over T unsafe { ptr.as_ref() } diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index 14f98fee60..29d1b02720 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -634,7 +634,7 @@ impl<T: ObjectType> Owned<T> { /// back to `from_raw()` (assuming the original `Owned` was valid!), /// since the owned reference remains there between the calls to /// `into_raw()` and `from_raw()`. - pub unsafe fn from_raw(ptr: *const T) -> Self { + pub const unsafe fn from_raw(ptr: *const T) -> Self { // SAFETY NOTE: while NonNull requires a mutable pointer, only // Deref is implemented so the pointer passed to from_raw // remains const -- 2.49.0