rust: vmstate: use "cast()" instead of "as"
PATCH 1/1 rust: vmstate: use "cast()" instead of "as"
Reported by clippy, fix it.
Signed-off-by Paolo Bonzini <[email protected]>
--- rust/migration/src/vmstate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/migration/src/vmstate.rs +1 -1
@@ -144,7 +144,7 @@ macro_rules! vmstate_of { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name),"\0" ) .as_bytes () - .as_ptr ()as *const ::std::os::raw::c_char , + .as_ptr ().cast ::<::std::os::raw::c_char >(), offset: ::std::mem::offset_of!($struct_name, $field_name), $(num_offset: ::std::mem::offset_of!($struct_name, $num),)? $(field_exists: $crate::vmstate_exist_fn!($struct_name, $test_fn),)?
Signature · 1 line
2.51.0
Quoted 5 lines · Paolo Bonzini
Reported by clippy, fix it.
Signed-off-by Paolo Bonzini <[email protected]>---
Reviewed-by Manos Pitsidianakis <[email protected]>
Quoted 20 lines
rust/migration/src/vmstate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)rust/migration/src/vmstate.rs +1
-2@@ -144,7 +144,7 @@ macro_rules! vmstate_of { $crate::bindings::VMStateField { name: ::core::concat!(::core::stringify!($field_name),"\0" ) .as_bytes () - .as_ptr ()as *const ::std::os::raw::c_char , + .as_ptr ().cast ::<::std::os::raw::c_char >(), offset: ::std::mem::offset_of!($struct_name, $field_name), $(num_offset: ::std::mem::offset_of!($struct_name, $num),)? $(field_exists: $crate::vmstate_exist_fn!($struct_name, $test_fn),)? --2.51.0
Quoted 10 lines · Paolo Bonzini
Date: Fri, 19 Sep 2025 10:36:25 +0200
From: Paolo Bonzini <[email protected]>
Subject: [PATCH] rust: vmstate: use "cast()" instead of "as"Reported by clippy, fix it.
Signed-off-by Paolo Bonzini <[email protected]>--- rust/migration/src/vmstate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Zhao Liu <[email protected]>