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@xxxxxxxxx>
Signed-off-by: Trevor Gross <tmgross@xxxxxxxxx>
---
Original mention of this problem in [1]
[1]: https://lore.kernel.org/rust-for-linux/20231008.164906.1151622782836568538.fujita.tomonori@xxxxxxxxx/
[...]Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>