]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: pin-init: add `syn` dependency and remove `proc-macro[2]` and `quote` workarounds
authorBenno Lossin <lossin@kernel.org>
Fri, 16 Jan 2026 10:54:18 +0000 (11:54 +0100)
committerBenno Lossin <lossin@kernel.org>
Sat, 17 Jan 2026 09:49:31 +0000 (10:49 +0100)
commit514e4ed2c9da9112fcd378b1bd9b9d120edf7ca9
treed4c5ff614ceb5d8d62761803885b433c12439838
parent901f1d73d2c68017065212d75ffbfbffa119921e
rust: pin-init: add `syn` dependency and remove `proc-macro[2]` and `quote` workarounds

`syn` makes parsing Rust from proc-macros a lot simpler. `pin-init` has
not used `syn` up until now, because the we did not support it. That
changed in commit 54e3eae85562 ("Merge patch series "`syn` support""),
so we can finally utilize the added ergonomics of parsing proc-macro
input with `syn`.

Previously we only had the `proc-macro` library available, whereas the
user-space version also used `proc-macro2` and `quote`. Now both are
available, so remove the workarounds.

Due to these changes, clippy emits warnings about unnecessary
`.to_string()` as `proc-macro2` provides an additional `PartialEq` impl
on `Ident`, so the warnings are fixed.

[ Adjusted wording from upstream version and added build system changes
  for the kernel - Benno ]

Co-developed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Tamir Duberstein <tamird@gmail.com>
Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/Makefile
rust/pin-init/internal/src/helpers.rs
rust/pin-init/internal/src/lib.rs
rust/pin-init/internal/src/pin_data.rs
rust/pin-init/internal/src/pinned_drop.rs
rust/pin-init/internal/src/zeroable.rs
scripts/generate_rust_analyzer.py