diff options
| author | 2026-09-04 15:12:30 +0100 | |
|---|---|---|
| committer | 2026-09-14 01:36:05 +0100 | |
| commit | 1ee699c4516607c0b594813c9c81da4285ed7d56 (patch) | |
| tree | fa535e745f47406dab5b37d71ee1191fcbb68023 /scripts/Makefile.thinlto | |
| parent | rust: pin-init: internal: extract utility code to new module (diff) | |
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 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
