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

Gary Guo posted 8 patches 1 month ago
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(-)
[PATCH 0/8] rust: pin-init: internal refactors
Posted by Gary Guo 1 month ago
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.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
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,
--  
Gary Guo <gary@garyguo.net>
Re: [PATCH 0/8] rust: pin-init: internal refactors
Posted by Gary Guo 3 weeks, 4 days ago
On Tue May 12, 2026 at 1:09 PM BST, Gary Guo wrote:
> 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.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> Gary Guo (7):
>       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

Applied these as well.

Best,
Gary
Re: (subset) [PATCH 0/8] rust: pin-init: internal refactors
Posted by Gary Guo 4 weeks, 1 day ago
On Tue May 12, 2026 at 1:09 PM BST, Gary Guo wrote:
> 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.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> Gary Guo (2):
>       rust: pin-init: internal: pin_data: use closure for `handle_field`
>       rust: pin-init: internal: add `PhantomInvariant` and `PhantomInvariantLifetime`
>
> Mohamad Alsadhan (1):
>       rust: pin-init: internal: pin_data: add struct to record field info

I've applied the above subset to pin-init-next, the two PRs that introduce these
commits are merged on GitHub side so other PRs that depend on them can be
rebased and tested with our CI suite.

I plan to apply the other patches in the series next Monday, and then send out a
new round of sync patches series of 3-4 upstream improvement PRs that depend on
them.

Best,
Gary