Re: [PATCH v3 02/13] rust: init: make `#[pin_data]` compatible with conditional compilation of fields

From: Martin Rodriguez Reboredo
Date: Sat Aug 05 2023 - 13:16:27 EST


On 7/29/23 06:09, Benno Lossin wrote:
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: Martin Rodriguez Reboredo <yakoyoku@xxxxxxxxx>