diff options
| author | Mohamad Alsadhan <mo@sdhn.cc> | 2026-09-04 15:12:30 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2026-09-14 01:36:05 +0100 |
| commit | 1ee699c4516607c0b594813c9c81da4285ed7d56 (patch) | |
| tree | fa535e745f47406dab5b37d71ee1191fcbb68023 /tools/lib/python/kdoc/python_version.py | |
| parent | c2bc9bd605add0b9f1f3b7e93b649bd814de226a (diff) | |
| download | linux-next-1ee699c4516607c0b594813c9c81da4285ed7d56.tar.gz linux-next-1ee699c4516607c0b594813c9c81da4285ed7d56.zip | |
rust: pin-init: internal: pin_data: support tuple struct projections
`#[pin_data]` rejects tuple structs because it assumes every field has a
name, which it uses for the projection field, the `__Unpin` field and the
pin-data accessor.
Identify fields by `syn::Member` instead, so that tuple fields are referred
to by their index in generated field accesses. The names that generated
items still need are derived from the index as `_0`, `_1`, etc.
The projection of a tuple struct is a tuple struct itself, so projected
fields are accessed with the same `.0`, `.1` syntax as on the input
type rather than through synthesised names.
Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc>
[ Moved utility code to util.rs as extension trait - Gary ]
Link: https://patch.msgid.link/20260904-tuple-struct-v1-2-72c50bd037fd@garyguo.net
Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
