[PATCH] rust: hpet: fix new warning

Paolo Bonzini posted 1 patch 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250617081038.115099-1-pbonzini@redhat.com
rust/hw/timer/hpet/src/device.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rust: hpet: fix new warning
Posted by Paolo Bonzini 5 months ago
Nightly rustc complains that HPETAddrDecode has a lifetime but it is not
clearly noted that it comes from &self.  Apply the compiler's suggestion
to shut it up.

Cc: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/hw/timer/hpet/src/device.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/hw/timer/hpet/src/device.rs b/rust/hw/timer/hpet/src/device.rs
index a281927781e..acf7251029e 100644
--- a/rust/hw/timer/hpet/src/device.rs
+++ b/rust/hw/timer/hpet/src/device.rs
@@ -771,7 +771,7 @@ fn reset_hold(&self, _type: ResetType) {
         self.rtc_irq_level.set(0);
     }
 
-    fn decode(&self, mut addr: hwaddr, size: u32) -> HPETAddrDecode {
+    fn decode(&self, mut addr: hwaddr, size: u32) -> HPETAddrDecode<'_> {
         let shift = ((addr & 4) * 8) as u32;
         let len = std::cmp::min(size * 8, 64 - shift);
 
-- 
2.49.0
Re: [PATCH] rust: hpet: fix new warning
Posted by Zhao Liu 5 months ago
On Tue, Jun 17, 2025 at 10:10:38AM +0200, Paolo Bonzini wrote:
> Date: Tue, 17 Jun 2025 10:10:38 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] rust: hpet: fix new warning
> X-Mailer: git-send-email 2.49.0
> 
> Nightly rustc complains that HPETAddrDecode has a lifetime but it is not
> clearly noted that it comes from &self.  Apply the compiler's suggestion
> to shut it up.
> 
> Cc: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/timer/hpet/src/device.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Re: [PATCH] rust: hpet: fix new warning
Posted by Stefan Hajnoczi 5 months ago
On Tue, Jun 17, 2025 at 10:10:38AM +0200, Paolo Bonzini wrote:
> Nightly rustc complains that HPETAddrDecode has a lifetime but it is not
> clearly noted that it comes from &self.  Apply the compiler's suggestion
> to shut it up.
> 
> Cc: Zhao Liu <zhao1.liu@intel.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/hw/timer/hpet/src/device.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>