[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFMMM1KRM6VT.2W0EZPI2I8CYX@garyguo.net>
Date: Mon, 12 Jan 2026 12:57:17 +0000
From: "Gary Guo" <gary@...yguo.net>
To: "Benno Lossin" <lossin@...nel.org>, "Gary Guo" <gary@...yguo.net>,
"Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>,
"Fiona Behrens" <me@...enk.dev>, "Christian Schrefl"
<chrisi.schrefl@...il.com>
Cc: <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 01/15] rust: pin-init: remove `try_` versions of the
initializer macros
On Sun Jan 11, 2026 at 12:24 PM GMT, Benno Lossin wrote:
> The `try_[pin_]init!` versions of the initializer macros are
> superfluous. Instead of forcing the user to always write an error in
> `try_[pin_]init!` and not allowing one in `[pin_]init!`, combine them
> into `[pin_]init!` that defaults the error to
> `core::convert::Infallible`, but also allows to specify a custom one.
>
> Projects using pin-init still can provide their own defaulting
> initializers using the `try_` prefix by using the `#[default_error]`
> attribute added in a future patch.
>
> [ Adjust the definition of the kernel's version of the `try_`
> initializer macros - Benno]
>
> Signed-off-by: Benno Lossin <lossin@...nel.org>
Reviewed-by: Gary Guo <gary@...yguo.net>
> ---
> Changes in v2: none
> ---
> rust/kernel/init.rs | 8 +-
> 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/src/lib.rs | 118 ++++--------------------
> 5 files changed, 35 insertions(+), 122 deletions(-)
Powered by blists - more mailing lists