]> git.ipfire.org Git - thirdparty/qemu.git/commit
rust: qdev: const_refs_to_static
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Sep 2025 10:49:41 +0000 (12:49 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2025 17:00:56 +0000 (19:00 +0200)
commit2a8a7bb8aaf54c3c878a616884a2e4bb239b6095
tree7c51b2ce10d79839b24d89f898f75d8dfcba81c4
parentdcdee1e718f9400a2bf523f2b009fb936370ae4b
rust: qdev: const_refs_to_static

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()".

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250908105005.2119297-10-pbonzini@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
rust/hw/char/pl011/src/device.rs
rust/hw/timer/hpet/src/device.rs
rust/qemu-api-macros/src/lib.rs
rust/qemu-api-macros/src/tests.rs
rust/qemu-api/src/qdev.rs
rust/qemu-api/tests/tests.rs