Skip to contentSkip to conversation

rust: hpet: fix new warning

PATCH In review Paolo Bonzini 3 participants 3 messages Jun 17, 2025 Rust

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rust: hpet: fix new warning

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.

---
 rust/hw/timer/hpet/src/device.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rust/hw/timer/hpet/src/device.rs +1 -1
index a281927781e..acf7251029e 100644
@@ -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);
 
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 9 lines · Paolo Bonzini

Date: Tue, 17 Jun 2025 10:10:38 +0200
From: Paolo Bonzini <[email protected]>
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.

Quoted 5 lines
---
 rust/hw/timer/hpet/src/device.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)