Messages in this thread | | | Date | Mon, 09 Oct 2023 14:51:33 +0000 | From | Benno Lossin <> | Subject | Re: [PATCH] rust: macros: update 'paste!' macro to accept string literals |
| |
On 08.10.23 11:48, Trevor Gross wrote: > Enable combining identifiers with string literals in the 'paste!' macro. > This allows combining user-specified strings with affixes to create > namespaced identifiers. > > This sample code: > > macro_rules! m { > ($name:lit) => { > paste!(struct [<_some_ $name _struct_>];) > } > } > > m!("foo_bar"); > > Would previously cause a compilation error. It will now generate: > > struct _some_foo_bar_struct_; > > Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com> > Signed-off-by: Trevor Gross <tmgross@umich.edu>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
| |