]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: macros: convert `#[vtable]` macro to use `syn`
authorGary Guo <gary@garyguo.net>
Mon, 12 Jan 2026 17:07:14 +0000 (17:07 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 27 Jan 2026 23:55:24 +0000 (00:55 +0100)
commit5f160950a5cdc36f222299905e09a72f67ebfcd4
treef5e5f0aa0103cc298cdb3c53eb44286ccd78ea4b
parentf637bafe1ff15fa356c1e0576c32f077b9e6e46a
rust: macros: convert `#[vtable]` macro to use `syn`

`#[vtable]` is converted to use syn. This is more robust than the
previous heuristic-based searching of defined methods and functions.

When doing so, the trait and impl are split into two code paths as the
types are distinct when parsed by `syn`.

Reviewed-by: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://patch.msgid.link/20260112170919.1888584-4-gary@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/macros/lib.rs
rust/macros/vtable.rs