summaryrefslogtreecommitdiff
path: root/tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-01-12 17:07:15 +0000
committerMiguel Ojeda <ojeda@kernel.org>2026-01-28 00:55:24 +0100
commitc578ad703ae9a219aa4bdd13343cf5254541c5e3 (patch)
tree1b2ce44e85640bb951d914a34ebc37cad6261130 /tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git
parent5f160950a5cdc36f222299905e09a72f67ebfcd4 (diff)
rust: macros: use `syn` to parse `module!` macro
With `syn` being available in the kernel, use it to parse the complex custom `module!` macro to replace existing helpers. Only parsing is changed in this commit, the code generation is untouched. This has the benefit of better error message when the macro is used incorrectly, as it can point to a concrete span on what's going wrong. For example, if a field is specified twice, previously it reads: error: proc macro panicked --> samples/rust/rust_minimal.rs:7:1 | 7 | / module! { 8 | | type: RustMinimal, 9 | | name: "rust_minimal", 10 | | author: "Rust for Linux Contributors", 11 | | description: "Rust minimal sample", 12 | | license: "GPL", 13 | | license: "GPL", 14 | | } | |_^ | = help: message: Duplicated key "license". Keys can only be specified once. now it reads: error: duplicated key "license". Keys can only be specified once. --> samples/rust/rust_minimal.rs:13:5 | 13 | license: "GPL", | ^^^^^^^ 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-5-gary@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'tools/perf/lib/Documentation/tutorial/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions