Skip to content

rust: pin-init: internal refactors

Gary Guo lkml rust-for-linux 1 version In review

Get series with b4
b4 am [email protected] change-id 20260511-pin-init-sync-e04cf605b097

Versions newest first

  1. v1 Latest8 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8rust: pin-init: internal: pin_data: use closure for `handle_field`rust/pin-init/internal/src/pin_data.rs+70 -740 replies
2/8rust: pin-init: internal: pin_data: add struct to record field inforust/pin-init/internal/src/pin_data.rs+32 -210 replies
3/8rust: pin-init: internal: add `PhantomInvariant` and `PhantomInvariantLifetime`rust/pin-init/internal/src/pin_data.rs rust/pin-init/src/__internal.rs rust/pin-init/src/lib.rs+59 -210 replies
4/8rust: pin-init: internal: init: handle code blocks earlyrust/pin-init/internal/src/init.rs+55 -450 replies
5/8rust: pin-init: internal: use marker on drop guard type for pinned fieldsrust/pin-init/internal/src/init.rs rust/pin-init/internal/src/pin_data.rs rust/pin-init/src/__internal.rs+68 -440 replies
6/8rust: pin-init: internal: make `make_closure` inherent methodsrust/pin-init/internal/src/init.rs rust/pin-init/internal/src/pin_data.rs rust/pin-init/src/__internal.rs+23 -530 replies
7/8rust: pin-init: internal: project slots instead of referencesrust/pin-init/internal/src/init.rs rust/pin-init/internal/src/pin_data.rs rust/pin-init/src/__internal.rs +1 more+132 -1220 replies
8/8rust: pin-init: internal: project using full slotrust/pin-init/internal/src/init.rs rust/pin-init/internal/src/pin_data.rs rust/pin-init/src/lib.rs+9 -101 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] rust: pin-init: internal refactors

This series include some internal refactors to pin-init macros that simplifies the codebase and allows new features to be built more easily on top.

This includes the following upstream PRs:

- internal: pin_data: add struct to record field info
https://github.com/Rust-for-Linux/pin-init/pull/152

- internal: add PhantomInvariant and PhantomInvariantLifetime
https://github.com/Rust-for-Linux/pin-init/pull/150

- Rework initialization and accessor generation
https://github.com/Rust-for-Linux/pin-init/pull/143

There're more improvements/fixes/features upcoming that would benefit from this refactor, so I would want to land this relatively soon. Benno has looked at them and is OK with the approach, but didn't have time to do a full review; if someone else would like to take look at them it'll be hugely appreciated.

---
Gary Guo (7):
rust: pin-init: internal: pin_data: use closure for handle_field
rust: pin-init: internal: add PhantomInvariant and PhantomInvariantLifetime
rust: pin-init: internal: init: handle code blocks early
rust: pin-init: internal: use marker on drop guard type for pinned fields
rust: pin-init: internal: make make_closure inherent methods
rust: pin-init: internal: project slots instead of references
rust: pin-init: internal: project using full slot

Mohamad Alsadhan (1):
rust: pin-init: internal: pin_data: add struct to record field info

 rust/pin-init/internal/src/init.rs     | 156 ++++++++++--------------
 rust/pin-init/internal/src/pin_data.rs | 195 +++++++++++++-----------------
 rust/pin-init/src/__internal.rs        | 215 +++++++++++++++++++++++++--------
 rust/pin-init/src/lib.rs               |  24 ++--
 4 files changed, 324 insertions(+), 266 deletions(-)

---
base-commit: 430654211d566f86e8ee533ff1b01a42be6b602c
change-id: 20260511-pin-init-sync-e04cf605b097

Best regards,

Signature · 1 line
Gary Guo <[email protected]>