Rust-for-Linux / linux

Adding support for the Rust language to the Linux kernel.
https://rust-for-linux.com
Other
3.94k stars 420 forks source link

`concat_idents!` supporting non-idents vs. `paste!` #983

Open ojeda opened 1 year ago

ojeda commented 1 year ago

@nbdd0121 suggested:

It seems weird to me that this is called concat_idents despite working for more things than just idents.

How about just implement a simple version of the paste macro instead?

Cc @bjorn3 since he implemented it and @asahilina since she needs the functionality for the DRM abstractions.

See https://lore.kernel.org/rust-for-linux/20230225003156.4858d79e.gary@garyguo.net/.

The nightly concat_idents! does not appear to support paths either: https://godbolt.org/z/eYYnG6an5

Pros/cons of a core::paste! instead?

nbdd0121 commented 1 year ago

Impl: https://github.com/nbdd0121/linux/tree/paste