On Mon, Sep 08, 2025 at 12:49:41PM +0200, Paolo Bonzini wrote:
> Date: Mon,  8 Sep 2025 12:49:41 +0200
> From: Paolo Bonzini <[email protected]>
> Subject: [PATCH 09/33] rust: qdev: const_refs_to_static
> X-Mailer: git-send-email 2.51.0
> 
> Now that const_refs_static can be assumed, convert the members of
> the DeviceImpl trait from functions to constants.  This lets the
> compiler know that they have a 'static lifetime, and removes the
> need for the weird "Box::leak()".
> 
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
>  rust/hw/char/pl011/src/device.rs  |  4 +--
>  rust/hw/timer/hpet/src/device.rs  |  9 ++-----
>  rust/qemu-api-macros/src/lib.rs   |  8 +++---
>  rust/qemu-api-macros/src/tests.rs | 44 ++++++++++++++-----------------
>  rust/qemu-api/src/qdev.rs         | 19 +++++--------
>  rust/qemu-api/tests/tests.rs      |  4 +--
>  6 files changed, 33 insertions(+), 55 deletions(-)

Reviewed-by: Zhao Liu <[email protected]>


Reply via email to