From dcdee1e718f9400a2bf523f2b009fb936370ae4b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 8 Sep 2025 12:49:40 +0200 Subject: rust: vmstate: use const_refs_to_static The VMStateDescriptionBuilder already needs const_refs_static, so use it to remove the need for vmstate_clock! and vmstate_struct!, as well as to simplify the implementation for scalars. If the consts in the VMState trait can reference to static VMStateDescription, scalars do not need the info_enum_to_ref! indirection and structs can implement the VMState trait themselves. Reviewed-by: Zhao Liu Link: https://lore.kernel.org/r/20250908105005.2119297-9-pbonzini@redhat.com Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 5 ----- 1 file changed, 5 deletions(-) (limited to 'docs') diff --git a/docs/devel/rust.rst b/docs/devel/rust.rst index aca29e55c0..10b0590b56 100644 --- a/docs/devel/rust.rst +++ b/docs/devel/rust.rst @@ -84,11 +84,6 @@ patches are welcome: * ``&raw`` (stable in 1.82.0). -* referencing statics in constants (stable in 1.83.0). For now use a const - function; this is an important limitation for QEMU's migration stream - architecture (VMState). Right now, VMState lacks type safety because - it is hard to place the ``VMStateField`` definitions in traits. - * NUL-terminated file names with ``#[track_caller]`` are scheduled for inclusion as ``#![feature(location_file_nul)]``, but it will be a while before QEMU can use them. For now, there is special code in -- cgit 1.4.1