diff options
| author | Gary Guo <gary@garyguo.net> | 2026-08-11 14:55:56 +0100 |
|---|---|---|
| committer | Miguel Ojeda <ojeda@kernel.org> | 2026-10-02 21:05:01 +0200 |
| commit | a52a7596c376ac7bce5a5322c526d96e2780ad17 (patch) | |
| tree | 7bf7a31a43123a0509772a2dcee7170cb911b58a /tools/lib/python/kdoc/python_version.py | |
| parent | 5ec807292c55eff56387f32d5b2a0a81f2926b81 (diff) | |
| download | linux-next-a52a7596c376ac7bce5a5322c526d96e2780ad17.tar.gz linux-next-a52a7596c376ac7bce5a5322c526d96e2780ad17.zip | |
rust: macros: vtable: add `#[optional]` attribute
For most users of the `#[vtable]` macro, the optional methods do not have a
Rust-side default implementation; a `NULL` pointer is inserted into the
vtable and the C subsystem does things differently when it sees `NULL`.
Streamline this use case by providing a `#[optional]` attribute that does
what the `build_error!(VTABLE_DEFAULT_ERROR)` boilerplate does.
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260811-vtable_macro-v1-2-50c5aab3c211@garyguo.net
[ Rewrapped docs. Reworded message, comment and error for typos. Rebased.
- Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
