From: Benno Lossin <lossin@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
"Benno Lossin" <lossin@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Fiona Behrens" <me@kloenk.dev>,
"Christian Schrefl" <chrisi.schrefl@gmail.com>,
"Tamir Duberstein" <tamird@gmail.com>,
"Alban Kurti" <kurti@invicto.ai>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: [GIT PULL] Rust pin-init for v7.0
Date: Thu, 22 Jan 2026 11:10:27 +0100 [thread overview]
Message-ID: <20260122101027.1427972-1-lossin@kernel.org> (raw)
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
next reply other threads:[~2026-01-22 10:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 10:10 Benno Lossin [this message]
2026-01-28 15:03 ` [GIT PULL] Rust pin-init for v7.0 Miguel Ojeda
2026-01-28 17:05 ` Benno Lossin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260122101027.1427972-1-lossin@kernel.org \
--to=lossin@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=chrisi.schrefl@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=kurti@invicto.ai \
--cc=linux-kernel@vger.kernel.org \
--cc=me@kloenk.dev \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@gmail.com \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox