qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 0/4] rust: use attrs crate to parse #[property]


From: Paolo Bonzini
Subject: Re: [RFC PATCH 0/4] rust: use attrs crate to parse #[property]
Date: Thu, 17 Jul 2025 15:17:47 +0200



Il gio 17 lug 2025, 11:18 Manos Pitsidianakis <manos.pitsidianakis@linaro.org> ha scritto:
Looks OK to me but are we sure it's necessary? This dependency is just
a syn::parse wrapper under the hood. Even serde's derive macros use
syn directly: https://github.com/serde-rs/serde/blob/babafa54d283fb087fa94f50a2cf82fa9e582a7c/serde_derive/src/internals/attr.rs#L276

I'm not against dependencies mind you, but this replaces just a few
lines of code.

It depends on how many copies of the procedural macros parsing code we have (hence RFC).

If you introduced a #[device] or #[object] attribute, for example, it probably would make a lot more sense than for #[property] only. Besides the shorter code it would also provide more consistent error messages across the attributes.

For just one macro, what you have now is fine. I did this series mostly to have it ready and check that attrs respects the same MSRV as QEMU (it didn't :)).

Paolo



--
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd


reply via email to

[Prev in Thread] Current Thread [Next in Thread]