From: Gary Guo <gary@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>
Cc: rust-for-linux@vger.kernel.org
Subject: [GIT PULL] pin-init changes for v7.4-rc1
Date: Mon, 12 Oct 2026 19:44:28 +0100 [thread overview]
Message-ID: <20261012184429.1613374-1-gary@kernel.org> (raw)
Hi Miguel,
This is a cycle packed with feature updates. Two of the most anticipated
features, tuple struct support and safe self reference creation, has been
included in this pull request.
Safe self reference is a big one and is pushed a bit late in the cycle. The
initial plan was to include a minimum subset for this cycle because I was
worried about potential soundness issues; however during Plumbers it was agreed
that the features should be upstreamed at once. This is because the initial
users (Nova, JobQueue) would all need the advanced features, so it is better to
ensure that the feature get put into use for real, and it can iterate with
users, rather than being fully designed on paper. The existing safety checks
are already very comprehensive, and Benno and I are confident that if new ones
are discovered, it wouldn't affect the overall design.
That said, the the usage of the advanced features (invariance, existential
lifetime) shall be limited to the pre-agreed users only, so even in case where
the feature needs to be reworked, the blast radius is limited.
Another theme in this cycle is to improve the developer experience when things
are used wrongly. A lot of work has been done to use proper spans from
user-provided tokens so error message point to things that cause them. Many
common misuse scenarios also gain additional custom diagnostics.
All commits have been included in linux-next as of next-20261012.
Best,
Gary
The following changes since commit fd73f4a6659897191fa0d40695fe370925dd3780:
Linux 7.3-rc3 (2026-09-13 14:38:02 -0700)
are available in the Git repository at:
https://github.com/Rust-for-linux/linux.git tags/pin-init-v7.4
for you to fetch changes up to b7218f1996f8491dbe28632b70f444cb73f554df:
rust: pin-init: internal: suppress `explicit_outlives_requirements` (2026-10-12 00:27:53 +0100)
----------------------------------------------------------------
User visible changes:
- Support tuple structs.
- Allow safe creation of self references.
- Vastly improve diagnostics for common misuse scenarios.
Other changes:
- Use `mixed_site` hygiene consistently.
----------------------------------------------------------------
Gary Guo (47):
rust: pin-init: internal: extract utility code to new module
rust: pin-init: internal: init: emit `slot` using mixed site hygiene
rust: pin-init: internal: init: use `slot` identifier directly with mixed site
rust: pin-init: internal: init: provide span for slot projection
rust: pin-init: internal: use span of `Index` for generated identifiers
rust: pin-init: internal: pin_data: use HRTB to work around `trivial_bounds` for `Unpin`
rust: pin-init: internal: make `__init_data` and `__pin_data` safe
rust: pin-init: internal: remove associated type of `HasInitData`
rust: pin-init: internal: use `HasInitData` to provide inference help only
rust: pin-init: internal: add custom diagnostic when `#[pin_data]` is not implemented
rust: pin-init: add diagnostic attribute for `PinInit` and `Init`
rust: pin-init: internal: handle item and expr diagnostics differently
rust: pin-init: internal: make `DiagCtxt` available inside parser
rust: pin-init: internal: improve diagnostics robustness against panicking
rust: pin-init: internal: init: allow reborrow of `Pin<&mut T>` bindings
rust: pin-init: internal: init: improve diagnostics from field checks
rust: pin-init: internal: init: use span of `<-` or `:` for the init/write call.
rust: proc-macro2: enable `proc_macro_span` feature
rust: pin-init: internal: init: forget guards in reverse order
rust: pin-init: internal: init: set span location of guards
rust: pin-init: internal: add utility to handle generics merging
rust: pin-init: internal: add utility for extract a single attribute
rust: pin-init: internal: pin_data: move projection struct into `const _: ()` block
rust: pin-init: internal: pin_data: extract `#[cfg]` processing to its own function
rust: pin-init: internal: pin_data: rename `'__pin` lifetime to `'__this`
rust: pin-init: internal: pin_data: parse into `StructInfo` before generating
kbuild: rust: allow `clippy::comparison_chain` globally
rust: pin-init: internal: pin_data: infer self-referential struct
rust: pin-init: internal: pin_data: rewrite fields that borrow others
rust: pin-init: internal: pin_data: pin borrowed fields with wrapper
rust: pin-init: internal: pin_data: teach drop check about generics that cannot dangle
rust: pin-init: internal: pin_data: self-referential drop order checks
rust: pin-init: internal: pin_data: check covariance of self-referential fields
rust: pin-init: internal: pin_data: implement initialization of borrowed structs
rust: pin-init: internal: pin_data: project self-referential fields
rust: pin-init: internal: pin_data: add `with_project` method
rust: pin-init: internal: pin_data: enable self-referential support
rust: pin-init: internal: pin_data: allow lifetime to be shortened per field drop order
rust: pin-init: internal: pin_data: parse explicit `#[borrowed]` annotation
rust: pin-init: internal: pin_data: support mutable borrows
rust: pin-init: internal: pin_data: parse explicit `#[uses]` annotation
rust: pin-init: internal: pin_data: make field lifetime invariance imply type invariance
rust: pin-init: internal: pin_data: complete invariant borrow support
rust: pin-init: internal: pin_data: perform AST lifetime replacement if possible
rust: pin-init: internal: pin_data: support shared projection
rust: pin-init: internal: pin_data: support existential lifetimes
rust: pin-init: internal: suppress `explicit_outlives_requirements`
Mohamad Alsadhan (3):
rust: pin-init: internal: pin_data: support tuple struct projections
rust: pin-init: internal: init: support tuple structs in `[pin_]init!`
rust: pin-init: internal: init: support tuple struct constructor syntax
Makefile | 2 +
rust/Makefile | 1 +
rust/pin-init/examples/selfref.rs | 60 +
rust/pin-init/internal/src/diagnostics.rs | 153 ++-
rust/pin-init/internal/src/init.rs | 683 ++++++++--
rust/pin-init/internal/src/lib.rs | 41 +-
rust/pin-init/internal/src/pin_data.rs | 2013 +++++++++++++++++++++++++----
rust/pin-init/internal/src/util.rs | 500 +++++++
rust/pin-init/src/__internal.rs | 417 +++++-
rust/pin-init/src/lib.rs | 83 +-
rust/proc-macro2/README.md | 3 +-
rust/proc-macro2/probe/proc_macro_span.rs | 9 -
12 files changed, 3511 insertions(+), 454 deletions(-)
create mode 100644 rust/pin-init/examples/selfref.rs
create mode 100644 rust/pin-init/internal/src/util.rs
next reply other threads:[~2026-10-12 18:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 18:44 Gary Guo [this message]
2026-10-12 19:25 ` [GIT PULL] pin-init changes for v7.4-rc1 Miguel Ojeda
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=20261012184429.1613374-1-gary@kernel.org \
--to=gary@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.