Re: [PATCH v3 05/13] rust: init: add initialization macros

From: Andreas Hindborg
Date: Fri Mar 31 2023 - 08:03:52 EST



y86-dev@xxxxxxxxxxxxxx writes:

> From: Benno Lossin <y86-dev@xxxxxxxxxxxxxx>
>
> Add the following initializer macros:
> - `#[pin_data]` to annotate structurally pinned fields of structs,
> needed for `pin_init!` and `try_pin_init!` to select the correct
> initializer of fields.
> - `pin_init!` create a pin-initializer for a struct with the
> `Infallible` error type.
> - `try_pin_init!` create a pin-initializer for a struct with a custom
> error type (`kernel::error::Error` is the default).
> - `init!` create an in-place-initializer for a struct with the
> `Infallible` error type.
> - `try_init!` create an in-place-initializer for a struct with a custom
> error type (`kernel::error::Error` is the default).
>
> Also add their needed internal helper traits and structs.
>
> Co-developed-by: Gary Guo <gary@xxxxxxxxxxx>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
> Signed-off-by: Benno Lossin <y86-dev@xxxxxxxxxxxxxx>
> ---

Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxxx>