]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: pin-init: internal: pin_data: filter non-`#[cfg]` attr in generated code
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 27 May 2026 17:19:52 +0000 (18:19 +0100)
committerGary Guo <gary@garyguo.net>
Fri, 29 May 2026 20:34:53 +0000 (21:34 +0100)
commit28ba76f374bf5fec9e5bf5035ffe90e4c6b05682
tree98add5201a5bc904f3efe894a9f3b1ded6763198
parent6fb5912c92926025a7e205d53feb73c3478c79a1
rust: pin-init: internal: pin_data: filter non-`#[cfg]` attr in generated code

When using a macro with custom attributes in a `#[pin_data]` struct it
can mess up the generated code. The generated code needs nothing more than
the `#[cfg]` attribute, thus strip away all other attributes.

[ Rebased and updated to only include `#[cfg]` instead of both `#[cfg]` and
  `#[doc]`; doc is not needed for the generated hidden items. - Gary ]

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Co-developed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260527-pin-init-sync-v1-1-e20335ed2501@garyguo.net
Signed-off-by: Gary Guo <gary@garyguo.net>
rust/pin-init/internal/src/pin_data.rs