public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] Rust pin-init for v7.0
@ 2026-01-22 10:10 Benno Lossin
  2026-01-28 15:03 ` Miguel Ojeda
  0 siblings, 1 reply; 3+ messages in thread
From: Benno Lossin @ 2026-01-22 10:10 UTC (permalink / raw)
  To: Miguel Ojeda, Benno Lossin, Gary Guo, Boqun Feng,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Fiona Behrens, Christian Schrefl,
	Tamir Duberstein, Alban Kurti
  Cc: linux-kernel, rust-for-linux

Hi Miguel,

Lot's of changes in this one, mainly the `syn` rewrite, but also some
smaller changes such as removing the `try_` versions of the macros in
pin-init (the kernel still declares its own).

All commits have been in linux-next since Monday.

The first commit in my tree is also in the `syn` patch series from Gary
[1], to avoid problems it should be merged after this tag. There also is
a "phantom conflict" with 74e15ac34b098 ("scripts:
generate_rust_analyzer: Add pin_init_internal deps") in rust-fixes,
which you already saw in linux-next [2]. Otherwise no conflicts
expected.

Please pull for v7.0 -- thanks!

Cheers,
Benno

[1]: https://lore.kernel.org/all/20260112170919.1888584-1-gary@kernel.org
[2]: https://lore.kernel.org/all/aW5GPwfJPrQjm-wC@sirena.org.uk

The following changes since commit 0f61b1860cc3f52aef9036d7235ed1f017632193:

  Linux 6.19-rc5 (2026-01-11 17:03:14 -1000)

are available in the Git repository at:

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

for you to fetch changes up to aeb5ecad5316f6af160993915163367290825b6b:

  rust: pin-init: Implement `InPlaceWrite<T>` for `&'static mut MaybeUninit<T>` (2026-01-17 10:53:28 +0100)

----------------------------------------------------------------
pin-init changes for v7.0

Added:

- '&'static mut MaybeUninit<T>' now implements 'InPlaceWrite'. This
  enables users to use external allocation mechanisms such as
  'static_cell'.

- Gary Guo as a Maintainer.

Changed:

- Rewrote all proc-macros ('[pin_]init!', '#[pin_data]',
  '#[pinned_drop]', 'derive([Maybe]Zeroable)'),  using 'syn' with better
  diagnostics.

- 'derive([Maybe]Zeroable)' now support tuple structs.

- '[pin_]init!' now supports attributes on fields (such as
  '#[cfg(...)]').

- Add a '#[default_error(<type>)]' attribute to '[pin_]init!' to
  override the default error (when no '? Error' is specified).

- Support packed struct in '[pin_]init!' with
  '#[disable_initialized_field_access]'.

Removed:

- 'try_[pin_]init!' have been removed in favor of merging their feature
  with '[pin_]init!'. The kernel's own 'try_[pin_]init!' macros have
  been updated to use the 'default_error' attribute.

Fixed:

- Corrected 'T: Sized' bounds to 'T: ?Sized' in the generated
  'PinnedDrop' check by '#[pin_data]'.

----------------------------------------------------------------
Benno Lossin (15):
      rust: pin-init: remove `try_` versions of the initializer macros
      rust: pin-init: allow the crate to refer to itself as `pin-init` in doc tests
      rust: pin-init: add `syn` dependency and remove `proc-macro[2]` and `quote` workarounds
      rust: pin-init: internal: add utility API for syn error handling
      rust: pin-init: rewrite `derive(Zeroable)` and `derive(MaybeZeroable)` using `syn`
      rust: pin-init: rewrite the `#[pinned_drop]` attribute macro using `syn`
      rust: pin-init: rewrite `#[pin_data]` using `syn`
      rust: pin-init: add `?Sized` bounds to traits in `#[pin_data]` macro
      rust: pin-init: rewrite the initializer macros using `syn`
      rust: pin-init: add `#[default_error(<type>)]` attribute to initializer macros
      rust: init: use `#[default_error(err)]` for the initializer macros
      rust: pin-init: internal: init: add support for attributes on initializer fields
      rust: pin-init: internal: init: add escape hatch for referencing initialized fields
      rust: pin-init: internal: init: simplify Zeroable safety check
      MAINTAINERS: add Gary Guo to pin-init

Oleksandr Babak (1):
      rust: pin-init: Implement `InPlaceWrite<T>` for `&'static mut MaybeUninit<T>`

 MAINTAINERS                               |    1 +
 rust/Makefile                             |   16 +-
 rust/kernel/init.rs                       |   40 +-
 rust/pin-init/README.md                   |    2 +-
 rust/pin-init/examples/linked_list.rs     |   19 +-
 rust/pin-init/examples/pthread_mutex.rs   |   10 +-
 rust/pin-init/internal/src/diagnostics.rs |   30 +
 rust/pin-init/internal/src/helpers.rs     |  152 ---
 rust/pin-init/internal/src/init.rs        |  548 ++++++++++
 rust/pin-init/internal/src/lib.rs         |   48 +-
 rust/pin-init/internal/src/pin_data.rs    |  615 +++++++++--
 rust/pin-init/internal/src/pinned_drop.rs |   88 +-
 rust/pin-init/internal/src/zeroable.rs    |  157 ++-
 rust/pin-init/src/lib.rs                  |  200 +---
 rust/pin-init/src/macros.rs               | 1677 -----------------------------
 scripts/generate_rust_analyzer.py         |    2 +-
 16 files changed, 1305 insertions(+), 2300 deletions(-)
 create mode 100644 rust/pin-init/internal/src/diagnostics.rs
 delete mode 100644 rust/pin-init/internal/src/helpers.rs
 create mode 100644 rust/pin-init/internal/src/init.rs
 delete mode 100644 rust/pin-init/src/macros.rs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GIT PULL] Rust pin-init for v7.0
  2026-01-22 10:10 [GIT PULL] Rust pin-init for v7.0 Benno Lossin
@ 2026-01-28 15:03 ` Miguel Ojeda
  2026-01-28 17:05   ` Benno Lossin
  0 siblings, 1 reply; 3+ messages in thread
From: Miguel Ojeda @ 2026-01-28 15:03 UTC (permalink / raw)
  To: Benno Lossin, Gary Guo
  Cc: Miguel Ojeda, Boqun Feng, Björn Roy Baron, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Fiona Behrens,
	Christian Schrefl, Tamir Duberstein, Alban Kurti, linux-kernel,
	rust-for-linux

On Thu, Jan 22, 2026 at 11:10 AM Benno Lossin <lossin@kernel.org> wrote:
>
> Hi Miguel,
>
> Lot's of changes in this one, mainly the `syn` rewrite, but also some
> smaller changes such as removing the `try_` versions of the macros in
> pin-init (the kernel still declares its own).
>
> All commits have been in linux-next since Monday.
>
> The first commit in my tree is also in the `syn` patch series from Gary
> [1], to avoid problems it should be merged after this tag. There also is
> a "phantom conflict" with 74e15ac34b098 ("scripts:
> generate_rust_analyzer: Add pin_init_internal deps") in rust-fixes,
> which you already saw in linux-next [2]. Otherwise no conflicts
> expected.
>
> Please pull for v7.0 -- thanks!

Merged into `rust-next` and Gary's series (without his first patch)
right after that -- thank you!

By the way, in the PR message, it would be nice if you could use the
imperative, since that is nowadays the style maintainers should use
for PRs. I reworded it a bit to conform, please take a look.

e.g. instead of "'...' now support ...", I wrote "Support ... in
'...'" (and so on).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GIT PULL] Rust pin-init for v7.0
  2026-01-28 15:03 ` Miguel Ojeda
@ 2026-01-28 17:05   ` Benno Lossin
  0 siblings, 0 replies; 3+ messages in thread
From: Benno Lossin @ 2026-01-28 17:05 UTC (permalink / raw)
  To: Miguel Ojeda, Gary Guo
  Cc: Miguel Ojeda, Boqun Feng, Björn Roy Baron, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Fiona Behrens,
	Christian Schrefl, Tamir Duberstein, Alban Kurti, linux-kernel,
	rust-for-linux

On Wed Jan 28, 2026 at 4:03 PM CET, Miguel Ojeda wrote:
> On Thu, Jan 22, 2026 at 11:10 AM Benno Lossin <lossin@kernel.org> wrote:
>>
>> Hi Miguel,
>>
>> Lot's of changes in this one, mainly the `syn` rewrite, but also some
>> smaller changes such as removing the `try_` versions of the macros in
>> pin-init (the kernel still declares its own).
>>
>> All commits have been in linux-next since Monday.
>>
>> The first commit in my tree is also in the `syn` patch series from Gary
>> [1], to avoid problems it should be merged after this tag. There also is
>> a "phantom conflict" with 74e15ac34b098 ("scripts:
>> generate_rust_analyzer: Add pin_init_internal deps") in rust-fixes,
>> which you already saw in linux-next [2]. Otherwise no conflicts
>> expected.
>>
>> Please pull for v7.0 -- thanks!
>
> Merged into `rust-next` and Gary's series (without his first patch)
> right after that -- thank you!
>
> By the way, in the PR message, it would be nice if you could use the
> imperative, since that is nowadays the style maintainers should use
> for PRs.

Will do!

> I reworded it a bit to conform, please take a look.

Changes look good to me.

Cheers,
Benno

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-28 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 10:10 [GIT PULL] Rust pin-init for v7.0 Benno Lossin
2026-01-28 15:03 ` Miguel Ojeda
2026-01-28 17:05   ` Benno Lossin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox