lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLgjDwayRzHXS2Dp6ztURBvnv3md3_jnzyL0ZmBQzTnH7gA@mail.gmail.com>
Date: Thu, 28 Aug 2025 15:05:48 +0200
From: Alice Ryhl <aliceryhl@...gle.com>
To: Benno Lossin <lossin@...nel.org>
Cc: Jesung Yang <y.j3ms.n@...il.com>, Miguel Ojeda <ojeda@...nel.org>, 
	Alex Gaynor <alex.gaynor@...il.com>, Boqun Feng <boqun.feng@...il.com>, 
	Gary Guo <gary@...yguo.net>, Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>, 
	Danilo Krummrich <dakr@...nel.org>, Alexandre Courbot <acourbot@...dia.com>, linux-kernel@...r.kernel.org, 
	rust-for-linux@...r.kernel.org, nouveau@...ts.freedesktop.org
Subject: Re: [PATCH v2 2/5] rust: macros: extend custom `quote!()` macro

On Thu, Aug 28, 2025 at 9:14 AM Benno Lossin <lossin@...nel.org> wrote:
>
> On Thu Aug 28, 2025 at 8:39 AM CEST, Alice Ryhl wrote:
> > On Fri, Aug 15, 2025 at 7:32 AM Jesung Yang <y.j3ms.n@...il.com> wrote:
> >> +    (@proc $v:ident $span:ident == $($tt:tt)*) => {
> >> +        $v.push(::proc_macro::TokenTree::Punct(
> >> +                ::proc_macro::Punct::new('=', ::proc_macro::Spacing::Joint)
> >> +        ));
> >> +        $v.push(::proc_macro::TokenTree::Punct(
> >> +                ::proc_macro::Punct::new('=', ::proc_macro::Spacing::Alone)
> >> +        ));
> >> +        quote_spanned!(@proc $v $span $($tt)*);
> >
> > Not a blocker, but if the way to implement this one is to push =
> > twice, then I think the pattern should just be a single = and then you
> > push a = once. The pattern can match twice to handle ==.
>
> You can't do that, since the first one needs the `Joint` spacing and the
> second one the `Alone` one. `==` also is a single token in macro input,
> so matching only on `=` doesn't work.

Ah, ok. LGTM then.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ