[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874j0dnbrq.fsf@kernel.org>
Date: Fri, 28 Feb 2025 19:51:21 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>
Cc: "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>, "Miguel Ojeda"
<ojeda@...nel.org>, "Petr Mladek" <pmladek@...e.com>, "Steven Rostedt"
<rostedt@...dmis.org>, "Andy Shevchenko"
<andriy.shevchenko@...ux.intel.com>, "Rasmus Villemoes"
<linux@...musvillemoes.dk>, "Sergey Senozhatsky"
<senozhatsky@...omium.org>, "Andrew Morton" <akpm@...ux-foundation.org>,
"Boqun Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno
Lossin"
<benno.lossin@...ton.me>, "Trevor Gross" <tmgross@...ch.edu>, "Maarten
Lankhorst" <maarten.lankhorst@...ux.intel.com>, "Maxime Ripard"
<mripard@...nel.org>, "Thomas Zimmermann" <tzimmermann@...e.de>, "David
Airlie" <airlied@...il.com>, "Simona Vetter" <simona@...ll.ch>,
<linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v2 2/5] rust: macros: support additional tokens in quote!
"Alice Ryhl" <aliceryhl@...gle.com> writes:
> This gives the quote! macro support for the following additional tokens:
>
> * The = token.
> * The _ token.
> * Using #my_var with variables of type Ident.
>
> Additionally, some type annotations are added to allow cases where
> groups are empty. For example, quote! does support () in the input, but
> only when it is *not* empty. When it is empty, the compiler cannot infer
> the item type of `tokens`.
>
> These additional quote! features are used by a new proc macro that
> generates code looking like this:
>
> const _: () = {
> if true {
> ::kernel::bindings::#name
> } else {
> #name
> };
> };
>
> where #name has type Ident.
>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Andreas Hindborg <a.hindborg@...nel.org>
Best regards,
Andreas Hindborg
Powered by blists - more mailing lists