From: Benno Lossin <lossin@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Breno Leitao" <leitao@debian.org>,
"Fiona Behrens" <me@kloenk.dev>,
"Christian Schrefl" <chrisi.schrefl@gmail.com>,
"Alban Kurti" <kurti@invicto.ai>,
"Michael Vetter" <jubalh@iodoru.org>
Cc: linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [GIT PULL] Rust pin-init for v6.17
Date: Tue, 8 Jul 2025 16:14:40 +0200 [thread overview]
Message-ID: <20250708141442.1339091-1-lossin@kernel.org> (raw)
Hi Miguel,
This time there are a couple of interesting changes, see below. Most
importantly, we can now use `Result` as an initializer. And implement
`Zeroable` via the `MaybeZeroable` derive macro. When the second part of
[1] is merged, this will make all types in bindings that can be zeroed
implement `Zeroable`.
There is one small mistake in the second commit e832374ccadf ("rust:
pin-init: change blanket impls for `[Pin]Init` and add one for
`Result<T, E>`") I forgot to ping Andreas about the changes in Rust
block and thus don't have his Acked-by. We discussed this privately
and he his okay with the changes. I didn't rebase due to the fact that
the commit already is pretty old and that Danilo already merged that
commit into driver-core-next, see below. Sorry about this!
All commits have been in linux-next for over three weeks.
No conflicts expected.
Note that driver-core-next is also merging the tag
`pin-init-v6.17-result-blanket` that includes the first two commits.
Please pull for v6.17 -- thanks!
[1]: https://lore.kernel.org/all/20250523145125.523275-1-lossin@kernel.org
---
Cheers,
Benno
The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494:
Linux 6.16-rc1 (2025-06-08 13:44:43 -0700)
are available in the Git repository at:
https://github.com/Rust-for-Linux/linux.git tags/pin-init-v6.17
for you to fetch changes up to fc3870dc5cadb701b4122e4a8daa85f9fa2f57b9:
rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests (2025-06-11 21:13:57 +0200)
----------------------------------------------------------------
pin-init changes for v6.17
Added:
- 'impl<T, E> [Pin]Init<T, E> for Result<T, E>', so results are now
(pin-)initializers.
- 'Zeroable::init_zeroed()' delegating to 'init_zeroed()'.
- New 'zeroed()', a safe version of 'mem::zeroed()' and also provide
it via 'Zeroable::zeroed()'.
- Implement 'Zeroable' for 'Option<&T>' and 'Option<&mut T>'.
- Implement 'Zeroable' for 'Option<[unsafe] [extern "abi"]
fn(...args...) -> ret>' for '"Rust"' and '"C"' ABIs and up to 20
arguments.
Changed:
- Blanket impls of 'Init' and 'PinInit' from 'impl<T, E> [Pin]Init<T, E>
for T' to 'impl<T> [Pin]Init<T> for T'.
- Renamed 'zeroed()' to 'init_zeroed()'.
Upstream dev news:
- More CI improvements to deny warnings, use '--all-targets'. Also check
the synchronization status of the two '-next' branches in upstream and
the kernel.
----------------------------------------------------------------
Benno Lossin (12):
rust: pin-init: improve safety documentation for `impl<T> [Pin]Init<T> for T`
rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result<T, E>`
rust: pin-init: examples, tests: add conditional compilation in order to compile under any feature combination
rust: pin-init: examples: pthread_mutex: disable the main test for miri
rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
rust: pin-init: rename `zeroed` to `init_zeroed`
rust: pin-init: add `Zeroable::init_zeroed`
rust: pin-init: add `zeroed()` & `Zeroable::zeroed()` functions
rust: pin-init: implement `ZeroableOption` for `&T` and `&mut T`
rust: pin-init: change `impl Zeroable for Option<NonNull<T>>` to `ZeroableOption for NonNull<T>`
rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests
Miguel Ojeda (2):
rust: init: re-enable doctests
rust: init: remove doctest's `Error::from_errno` workaround
rust/kernel/block/mq/tag_set.rs | 12 +-
rust/kernel/configfs.rs | 4 +-
rust/kernel/init.rs | 28 ++---
rust/pin-init/README.md | 2 +-
rust/pin-init/examples/big_struct_in_place.rs | 28 +++--
rust/pin-init/examples/linked_list.rs | 10 +-
rust/pin-init/examples/mutex.rs | 97 +++++++++-------
rust/pin-init/examples/pthread_mutex.rs | 4 +
rust/pin-init/examples/static_init.rs | 75 ++++++------
rust/pin-init/src/__internal.rs | 1 +
rust/pin-init/src/lib.rs | 158 ++++++++++++++++++++++----
rust/pin-init/src/macros.rs | 16 +--
12 files changed, 287 insertions(+), 148 deletions(-)
next reply other threads:[~2025-07-08 14:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 14:14 Benno Lossin [this message]
2025-07-08 18:33 ` [GIT PULL] Rust pin-init for v6.17 Andreas Hindborg
2025-07-13 21:13 ` 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=20250708141442.1339091-1-lossin@kernel.org \
--to=lossin@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--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=jubalh@iodoru.org \
--cc=kurti@invicto.ai \
--cc=leitao@debian.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@kloenk.dev \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).