Re: [PATCH v3 02/13] rust: init: make `#[pin_data]` compatible with conditional compilation of fields
From: Alice Ryhl
Date: Tue Aug 01 2023 - 07:03:09 EST
Benno Lossin <benno.lossin@xxxxxxxxx> writes:
> This patch allows one to write
> ```
> #[pin_data]
> pub struct Foo {
> #[cfg(CONFIG_BAR)]
> a: Bar,
> #[cfg(not(CONFIG_BAR))]
> a: Baz,
> }
> ```
> Before, this would result in a compile error, because `#[pin_data]`
> would generate two functions named `a` for both fields unconditionally.
>
> Signed-off-by: Benno Lossin <benno.lossin@xxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>