]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: pin-init: internal: init: add support for attributes on initializer fields
authorBenno Lossin <lossin@kernel.org>
Fri, 16 Jan 2026 10:54:27 +0000 (11:54 +0100)
committerBenno Lossin <lossin@kernel.org>
Sat, 17 Jan 2026 09:51:42 +0000 (10:51 +0100)
commitd26732e57b06ef32dadfc32d5de9ac39262698cb
tree9e8fae8bd95d09d9d1d58563d3402aeeb9bf53b6
parentd083a6214ca6d486ac58f84f8964c72028469342
rust: pin-init: internal: init: add support for attributes on initializer fields

Initializer fields ought to support the same attributes that are allowed
in struct initializers on fields. For example, `cfg` or lint levels such
as `expect`, `allow` etc. Add parsing support for these attributes using
syn to initializer fields and adjust the macro expansion accordingly.

Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/pin-init/internal/src/init.rs