]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: pin-init: add references to previously initialized fields
authorBenno Lossin <lossin@kernel.org>
Fri, 5 Sep 2025 14:00:46 +0000 (16:00 +0200)
committerBenno Lossin <lossin@kernel.org>
Thu, 11 Sep 2025 21:30:02 +0000 (23:30 +0200)
commit42415d163e5df6db799c7de6262d707e402c2c7e
tree49ce36ce08e84730400e2da8d9ddb4e968652c0e
parent1fa516794fdd27b96cee77f8b12ac916b8b6a9a7
rust: pin-init: add references to previously initialized fields

After initializing a field in an initializer macro, create a variable
holding a reference that points at that field. The type is either
`Pin<&mut T>` or `&mut T` depending on the field's structural pinning
kind.

[ Applied fixes to devres and rust_driver_pci sample - Benno]
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Benno Lossin <lossin@kernel.org>
rust/kernel/devres.rs
rust/pin-init/src/macros.rs
samples/rust/rust_driver_pci.rs