rust: hpet: fix new warning
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.
Cc Zhao Liu <[email protected]>
Signed-off-by Paolo Bonzini <[email protected]>
--- rust/hw/timer/hpet/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/hw/timer/hpet/src/device.rs +1 -1
@@ -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
Quoted 9 lines · Paolo Bonzini
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 <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- rust/hw/timer/hpet/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Stefan Hajnoczi <[email protected]>
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.0Nightly 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
Cc Zhao Liu <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- rust/hw/timer/hpet/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Zhao Liu <[email protected]>