]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: pin-init: internal: use marker on drop guard type for pinned fields
authorGary Guo <gary@garyguo.net>
Tue, 12 May 2026 12:09:50 +0000 (13:09 +0100)
committerGary Guo <gary@garyguo.net>
Mon, 18 May 2026 11:18:06 +0000 (12:18 +0100)
commit27693a56e8a697f78db535aad2d5267f286e1f51
treea1ee67ef184a29b6be1b0747e349532b03852ef1
parentdf1827babd665ea7039383dbc5c671b66a65c1ec
rust: pin-init: internal: use marker on drop guard type for pinned fields

Instead of projecting the created reference, simply create drop guards with
different marker types and have the `let_binding()` method of guards of
different marker produce different type instead.

This allows more flexible lifetime as this is now controlled by the guard.
This will be needed when implementing self-referential fields.

Signed-off-by: Gary Guo <gary@garyguo.net>
rust/pin-init/internal/src/init.rs
rust/pin-init/internal/src/pin_data.rs
rust/pin-init/src/__internal.rs