Re: [PATCH 07/15] rust: qemu_api_macros: add Wrapper derive macro

2025-02-24 Thread Zhao Liu
> +fn derive_opaque_or_error(input: DeriveInput) -> > Result { > +is_transparent_repr(&input, "#[derive(Wrapper)]")?; > + > +let name = &input.ident; > +let field = &get_unnamed_field(&input, "#[derive(Wrapper)]")?; > +let typ = &field.ty; > + > +// TODO: how to add "::qemu_api

[PATCH 07/15] rust: qemu_api_macros: add Wrapper derive macro

2025-02-21 Thread Paolo Bonzini
Add a derive macro that makes it easy to peel off all the layers of specialness (UnsafeCell, MaybeUninit, etc.) and just get a pointer to the wrapped type; and likewise add them back starting from a *mut. Signed-off-by: Paolo Bonzini --- docs/devel/rust.rst | 8 ++-- rust/qemu-api-m