Skip to contentSkip to conversation

pin-init changes for v7.2-rc1

GIT PULL Applied Gary Guo 3 participants 4 messages Jun 2 – Jun 6 Rust

lore
Share & tools
lore

Gary Guo

author
#0 lore raw

Hi Miguel,

There is more developments this cycle than the last one, with a mix of improvements and cleanups. No breaking changes to users expected.

Tuple structs did not make it this cycle, I hope it'll finally land the next one. I have also been working on getting pin-init to support self-referential types, which I plan to send next cycle (although unsure it can land in the next one).

The refactoring commits have been in linux-next for a while. There a few patches taken later in the cycle, and they have all been in linux-next since 2026-06-01. Feel free to wait for a few more rounds before pulling if you see fit.

Best,
Gary

The following changes since commit 5d6919055dec134de3c40167a490f33c74c12581:

Linux 7.1-rc3 (2026-05-10 14:08:09 -0700)

are available in the Git repository at:

https://github.com/Rust-for-Linux/linux.git tags/pin-init-v7.2

for you to fetch changes up to d2f309227952e73966682f348161094e40eb6440:

rust: pin_init: internal: use loop {} to produce never value (2026-05-29 21:58:36 +0100)

----------------------------------------------------------------
pin-init changes for v7.2

User visible changes:

- non_snake_case warnings will no longer be generated for identifiers that are syntactically just users of a field name. This would allow all #[allow(non_snake_case)] in nova-core to be removed, which I will send to nova tree next cycle.

- Non-cfg attributes are now properly filtered out in derived structs. This improves pin-init compatibility with other derive macros.

- Projection types have their where clause properly inserted now.

Other changes:

- MSRV is bumped to 1.82 and associated cleanups.

- There is an overhaul on how init slots are projected. The new approach is easier to justify with safety comments.

- More functions are marked as inline, which should help mitigate super-long symbol name issue due to lack of inlining.

- Various small code quality cleanups.

----------------------------------------------------------------
Alistair Francis (1):
rust: pin-init: examples: mark as #[inline] all From::from()s for Error

Benno Lossin (1):
rust: pin-init: internal: adjust license identifier of zeroable.rs

Gary Guo (17):
rust: pin-init: bump minimum Rust version to 1.82
rust: pin-init: internal: remove redundant #[pin] filtering
rust: pin-init: fix badge URL in README
rust: pin-init: cleanup workaround for old Rust compiler
rust: pin-init: internal: turn PhantomPinned error into warnings
rust: pin-init: internal: remove collect_tuple polyfill after MSRV bump
rust: pin-init: examples: fix useless_borrows_in_formatting clippy warning
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
rust: pin-init: move InitClosure out from __internal
rust: pin-init: remove E from InitClosure
rust: pin_init: internal: use loop {} to produce never value

Martin Kletzander (1):
rust: pin-init: internal: pin_data: filter non-#[cfg] attr in generated code

Mirko Adzic (2):
rust: pin-init: internal: suppress non_snake_case lint in #[pin_data]
rust: pin-init: internal: suppress non_snake_case lint in [pin_]init!

Mohamad Alsadhan (4):
rust: pin-init: cleanup Zeroable and ZeroableOptions
rust: pin-init: extend impl_zeroable_option macro to handle generics
rust: pin-init: internal: add missing where clause to projection types
rust: pin-init: internal: pin_data: add struct to record field info

Xiaobo Liu (1):
rust: pin-init: docs: fix typos in MaybeZeroable documentation

 rust/pin-init/README.md                       |   2 +-
 rust/pin-init/examples/big_struct_in_place.rs |   3 -
 rust/pin-init/examples/error.rs               |   2 +
 rust/pin-init/examples/linked_list.rs         |   2 -
 rust/pin-init/examples/mutex.rs               |   4 +-
 rust/pin-init/examples/pthread_mutex.rs       |   4 +-
 rust/pin-init/examples/static_init.rs         |   4 +-
 rust/pin-init/internal/src/diagnostics.rs     |  14 ++
 rust/pin-init/internal/src/init.rs            | 169 +++++++---------
 rust/pin-init/internal/src/lib.rs             |   1 -
 rust/pin-init/internal/src/pin_data.rs        | 268 ++++++++++++--------------
 rust/pin-init/internal/src/zeroable.rs        |   2 +-
 rust/pin-init/src/__internal.rs               | 231 +++++++++++++++-------
 rust/pin-init/src/lib.rs                      | 137 +++++++------
 14 files changed, 439 insertions(+), 404 deletions(-)
Applied
#1 lore raw
Quoted 9 lines · Gary Guo

There is more developments this cycle than the last one, with a mix of improvements and cleanups. No breaking changes to users expected.

Tuple structs did not make it this cycle, I hope it'll finally land the next one. I have also been working on getting pin-init to support self-referential types, which I plan to send next cycle (although unsure it can land in the next one).

Quoted 4 lines

The refactoring commits have been in linux-next for a while. There a few patches taken later in the cycle, and they have all been in linux-next since 2026-06-01. Feel free to wait for a few more rounds before pulling if you see fit.

Merged into rust-next -- thanks!

I have reworded the merge message to use the style Linus expects for merge commits, i.e. mainly using the imperative, like commit messages -- please take a look!

(For future PRs, it would help if you can follow the style)

Cheers,
Miguel

reviewer
#2 lore raw
Quoted 15 lines · Miguel Ojeda
Quoted 9 lines · Gary Guo

There is more developments this cycle than the last one, with a mix of improvements and cleanups. No breaking changes to users expected.

Tuple structs did not make it this cycle, I hope it'll finally land the next one. I have also been working on getting pin-init to support self-referential types, which I plan to send next cycle (although unsure it can land in the next one).

Quoted 4 lines

The refactoring commits have been in linux-next for a while. There a few patches taken later in the cycle, and they have all been in linux-next since 2026-06-01. Feel free to wait for a few more rounds before pulling if you see fit.

Quoted 5 lines

Merged into rust-next -- thanks!

I have reworded the merge message to use the style Linus expects for merge commits, i.e. mainly using the imperative, like commit messages -- please take a look!

Hi Miguel,

pin-init's CHANGELOG.md is following a passive voice style and I was following that style when writing the tag messages.

I'll make sure to use imperative mood for the kernel side of tags next time. (Maybe the pin-init changelog could use imperative mood too?)

Best,
Gary

Quoted 5 lines

(For future PRs, it would help if you can follow the style)

Cheers,
Miguel

#3 lore raw
Quoted 6 lines · Gary Guo

pin-init's CHANGELOG.md is following a passive voice style and I was following that style when writing the tag messages.

I'll make sure to use imperative mood for the kernel side of tags next time. (Maybe the pin-init changelog could use imperative mood too?)

Ah, that explains it -- no worries, if sometimes something slips it is fine, I can reword on my side if needed, but yeah, it helps to have it already that way to minimize possible mistakes on my side while rewording.

And it was your very first PR anyway, from a quick look, so it is completely fine.

Which makes me recall that I should have said: congratulations on your first PR! :)

Cheers,
Miguel