qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: vmstate: use "cast()" instead of "as"
@ 2025-09-19  8:36 Paolo Bonzini
  2025-09-19 10:41 ` Manos Pitsidianakis
  2025-09-23 14:43 ` Zhao Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2025-09-19  8:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust

Reported by clippy, fix it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 rust/migration/src/vmstate.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/migration/src/vmstate.rs b/rust/migration/src/vmstate.rs
index c05c4a1fd66..e04b19b3c9f 100644
--- a/rust/migration/src/vmstate.rs
+++ b/rust/migration/src/vmstate.rs
@@ -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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: vmstate: use "cast()" instead of "as"
  2025-09-19  8:36 [PATCH] rust: vmstate: use "cast()" instead of "as" Paolo Bonzini
@ 2025-09-19 10:41 ` Manos Pitsidianakis
  2025-09-23 14:43 ` Zhao Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Manos Pitsidianakis @ 2025-09-19 10:41 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Fri, Sep 19, 2025 at 11:37 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Reported by clippy, fix it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>

>  rust/migration/src/vmstate.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/rust/migration/src/vmstate.rs b/rust/migration/src/vmstate.rs
> index c05c4a1fd66..e04b19b3c9f 100644
> --- a/rust/migration/src/vmstate.rs
> +++ b/rust/migration/src/vmstate.rs
> @@ -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
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: vmstate: use "cast()" instead of "as"
  2025-09-19  8:36 [PATCH] rust: vmstate: use "cast()" instead of "as" Paolo Bonzini
  2025-09-19 10:41 ` Manos Pitsidianakis
@ 2025-09-23 14:43 ` Zhao Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Zhao Liu @ 2025-09-23 14:43 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, qemu-rust

On Fri, Sep 19, 2025 at 10:36:25AM +0200, Paolo Bonzini wrote:
> Date: Fri, 19 Sep 2025 10:36:25 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] rust: vmstate: use "cast()" instead of "as"
> 
> Reported by clippy, fix it.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  rust/migration/src/vmstate.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-23 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19  8:36 [PATCH] rust: vmstate: use "cast()" instead of "as" Paolo Bonzini
2025-09-19 10:41 ` Manos Pitsidianakis
2025-09-23 14:43 ` Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).