Re: [PATCH 07/22] rust: pin-init: move the default error behavior of `try_[pin_]init`

From: Fiona Behrens
Date: Wed Mar 05 2025 - 04:21:35 EST


Benno Lossin <benno.lossin@xxxxxxxxx> writes:

> Move the ability to just write `try_pin_init!(Foo { a <- a_init })`
> (note the missing `? Error` at the end) into the kernel crate.
> Remove this notation from the pin-init crate, since the default when no
> error is specified is the kernel-internal `Error` type. Instead add two
> macros in the kernel crate that serve this default and are used instead
> of the ones from `pin-init`.
>
> This is done, because the `Error` type that is used as the default is
> from the kernel crate and it thus prevents making the pin-init crate
> standalone.
>
> In order to not cause a build error due to a name overlap, the macros in
> the pin-init crate are renamed, but this change is reverted in a future
> commit when it is a standalone crate.
>
> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>

Reviewed-by: Fiona Behrens <me@xxxxxxxxxx>