diff options
author | Benno Lossin <[email protected]> | 2023-08-14 08:46:31 +0000 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2023-08-21 14:31:48 +0200 |
commit | f8badd150763ae0f9c8482fabe0fdbac81735d34 (patch) | |
tree | 2e751ab3ffa7184d23860e104b136c0db44eb15b /drivers/platform/surface/aggregator/ssh_parser.c | |
parent | b3068ac37b1c10ee4b9fb6c07a2e46021376c374 (diff) |
rust: init: make `#[pin_data]` compatible with conditional compilation of fields
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.
Reviewed-by: Martin Rodriguez Reboredo <[email protected]>
Reviewed-by: Gary Guo <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Signed-off-by: Benno Lossin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'drivers/platform/surface/aggregator/ssh_parser.c')
0 files changed, 0 insertions, 0 deletions