qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel <qemu-devel@nongnu.org>, qemu-rust@nongnu.org
Subject: Re: [RFC PATCH 0/4] rust: use attrs crate to parse #[property]
Date: Thu, 17 Jul 2025 15:17:47 +0200	[thread overview]
Message-ID: <CABgObfb_7vzL21HNd5MecEM3iHM+LxCJ42D8D7K-OJSQ_p4_kg@mail.gmail.com> (raw)
In-Reply-To: <CAAjaMXauWy1sk+JkjTRzAf8yA72Xk=Qbt4+yw7XNPfx=q4WTZg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

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
>
>

[-- Attachment #2: Type: text/html, Size: 2042 bytes --]

      reply	other threads:[~2025-07-17 15:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  6:27 [RFC PATCH 0/4] rust: use attrs crate to parse #[property] Paolo Bonzini
2025-07-17  6:27 ` [PATCH 1/4] subprojects: update proc-macro2 and syn Paolo Bonzini
2025-07-17  6:27 ` [PATCH 2/4] subprojects: add attrs crate Paolo Bonzini
2025-07-17  6:27 ` [PATCH 3/4] rust: qemu-api-macros: support matching more than one error Paolo Bonzini
2025-07-17  6:27 ` [PATCH 4/4] qemu-api-macros: switch #[property] parsing to use combinators Paolo Bonzini
2025-07-17  9:18 ` [RFC PATCH 0/4] rust: use attrs crate to parse #[property] Manos Pitsidianakis
2025-07-17 13:17   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABgObfb_7vzL21HNd5MecEM3iHM+LxCJ42D8D7K-OJSQ_p4_kg@mail.gmail.com \
    --to=pbonzini@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).