linux/rust
Benno Lossin f8badd1507 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 <yakoyoku@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20230814084602.25699-3-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-08-21 14:31:48 +02:00
..
alloc rust: upgrade to Rust 1.71.1 2023-08-14 17:50:02 +02:00
bindings rust: allocator: Prevent mis-aligned allocation 2023-08-04 17:10:31 +02:00
kernel rust: init: make #[pin_data] compatible with conditional compilation of fields 2023-08-21 14:31:48 +02:00
macros btf, scripts: rust: drop is_rust_module.sh 2023-08-10 22:28:04 +02:00
uapi rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
.gitignore rust: uapi: Add UAPI crate 2023-04-22 01:46:45 +02:00
bindgen_parameters rust: bindgen: Add alt_instr as opaque type 2023-03-02 22:44:15 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: upgrade to Rust 1.71.1 2023-08-14 17:50:02 +02:00
exports.c rust: add build_error crate 2022-12-04 01:59:16 +01:00
helpers.c rust: bindgen: upgrade to 0.65.1 2023-08-15 00:37:22 +02:00
Makefile scripts: generate_rust_analyzer: provide cfgs for core and alloc 2023-08-20 22:54:32 +02:00