summary refs log tree commit diff stats
path: root/rust/qemu-api/src/cell.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-09-08 12:49:36 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2025-09-17 19:00:56 +0200
commit71e84e5ae87b8e6adce3af7dd2a490c7b2f39772 (patch)
tree73b6ec6ec3cd777704a96c34ab19885bfd91da6a /rust/qemu-api/src/cell.rs
parente1c689c2189087bcab258f0a99019bb900986af7 (diff)
downloadfocaccia-qemu-71e84e5ae87b8e6adce3af7dd2a490c7b2f39772.tar.gz
focaccia-qemu-71e84e5ae87b8e6adce3af7dd2a490c7b2f39772.zip
rust: add missing const markers for MSRV==1.83.0
Rust 1.83 allows more functions to be marked const.
Fix clippy with bumped minimum supported Rust version.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250908105005.2119297-5-pbonzini@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/cell.rs')
-rw-r--r--rust/qemu-api/src/cell.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/rust/qemu-api/src/cell.rs b/rust/qemu-api/src/cell.rs
index 27063b049d..148a13e3f5 100644
--- a/rust/qemu-api/src/cell.rs
+++ b/rust/qemu-api/src/cell.rs
@@ -980,8 +980,7 @@ impl<T> Opaque<T> {
     /// but the functions containing the dereference are usually safe.  The
     /// value returned from `uninit()` must be initialized and pinned before
     /// calling them.
-    #[allow(clippy::missing_const_for_fn)]
-    pub unsafe fn uninit() -> Self {
+    pub const unsafe fn uninit() -> Self {
         Self {
             value: UnsafeCell::new(MaybeUninit::uninit()),
             _pin: PhantomPinned,
@@ -997,8 +996,7 @@ impl<T> Opaque<T> {
     /// but the functions containing the dereference are usually safe.  The
     /// value returned from `uninit()` must be pinned (and possibly initialized)
     /// before calling them.
-    #[allow(clippy::missing_const_for_fn)]
-    pub unsafe fn zeroed() -> Self {
+    pub const unsafe fn zeroed() -> Self {
         Self {
             value: UnsafeCell::new(MaybeUninit::zeroed()),
             _pin: PhantomPinned,