[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFLX8DNUAIJM.K5WFHHKGTWPP@kernel.org>
Date: Sun, 11 Jan 2026 18:03:58 +0100
From: "Benno Lossin" <lossin@...nel.org>
To: "Gary Guo" <gary@...yguo.net>, "Miguel Ojeda" <ojeda@...nel.org>, "Boqun
Feng" <boqun.feng@...il.com>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Andreas Hindborg" <a.hindborg@...nel.org>,
"Alice Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>,
"Danilo Krummrich" <dakr@...nel.org>, "Tamir Duberstein"
<tamird@...il.com>, "Igor Korotin" <igor.korotin.linux@...il.com>,
José Expósito <jose.exposito89@...il.com>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 03/11] rust: macros: convert `#[vtable]` macro to use
`syn`
On Wed Jan 7, 2026 at 5:15 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@...yguo.net>
>
> `#[vtable]` is converted to use syn. This is more robust than the
> previous heuristic-based searching of defined methods and functions.
>
> When doing so, the trait and impl are split into two code paths as the
> types are distinct when parsed by `syn`.
>
> Signed-off-by: Gary Guo <gary@...yguo.net>
Reviewed-by: Benno Lossin <lossin@...nel.org>
> ---
> rust/macros/lib.rs | 9 ++-
> rust/macros/vtable.rs | 163 ++++++++++++++++++++++--------------------
> 2 files changed, 93 insertions(+), 79 deletions(-)
> + // Skip if it's declared already -- this can happen if `#[cfg]` is used to selectively
> + // define functions.
> + // FIXME: `#[cfg]` should be copied and propagated to the generated consts.
Do you mind creating an issue (probably difficulty medium) after this is
merged?
Cheers,
Benno
> + if consts.contains(&gen_const_name) {
> + continue;
> + }
Powered by blists - more mailing lists