On Tue, Sep 16, 2025 at 11:34 AM Zhao Liu <[email protected]> wrote: > > error: `rename` shadows a previous, unrelated binding > --> qemu-macros/src/lib.rs:265:14 > | > 265 | |rename| -> Result<proc_macro2::TokenStream, Error> { > | ^^^^^^ > | > note: previous binding is here > --> qemu-macros/src/lib.rs:245:30 > | > 245 | let DeviceProperty { rename, defval } = prop; > | ^^^^^^ > = help: for further information visit > https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated > = note: requested on the command line with `-D clippy::shadow-unrelated` > > Rename the lambda parameter to "prop_rename" to fix the above clippy > error. > > Signed-off-by: Zhao Liu <[email protected]> > ---
Reviewed-by: Manos Pitsidianakis <[email protected]> > rust/qemu-macros/src/lib.rs | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/rust/qemu-macros/src/lib.rs b/rust/qemu-macros/src/lib.rs > index 830b4326985b..ed4064d6e110 100644 > --- a/rust/qemu-macros/src/lib.rs > +++ b/rust/qemu-macros/src/lib.rs > @@ -262,8 +262,8 @@ macro_rules! str_to_c_str { > > let prop_name = rename.map_or_else( > || str_to_c_str!(field_name.to_string(), field_name.span()), > - |rename| -> Result<proc_macro2::TokenStream, Error> { > - match rename { > + |prop_rename| -> Result<proc_macro2::TokenStream, Error> { > + match prop_rename { > DevicePropertyName::CStr(cstr_lit) => Ok(quote! { > #cstr_lit }), > DevicePropertyName::Str(str_lit) => { > str_to_c_str!(str_lit.value(), str_lit.span()) > -- > 2.34.1 >
