linux/rust/kernel
Benno Lossin d0fdc39612 rust: init: add PinnedDrop trait and macros
The `PinnedDrop` trait that facilitates destruction of pinned types.
It has to be implemented via the `#[pinned_drop]` macro, since the
`drop` function should not be called by normal code, only by other
destructors. It also only works on structs that are annotated with
`#[pin_data(PinnedDrop)]`.

Co-developed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20230408122429.1103522-10-y86-dev@protonmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-04-12 18:41:05 +02:00
..
init rust: init: add PinnedDrop trait and macros 2023-04-12 18:41:05 +02:00
sync rust: init/sync: add InPlaceInit trait to pin-initialize smart pointers 2023-04-12 18:41:05 +02:00
allocator.rs rust: add kernel crate 2022-09-28 08:58:24 +02:00
build_assert.rs rust: build_assert: add build_{error,assert}! macros 2022-12-04 01:59:16 +01:00
error.rs rust: error: Add from_result() helper 2023-04-12 18:41:04 +02:00
init.rs rust: init: add PinnedDrop trait and macros 2023-04-12 18:41:05 +02:00
lib.rs rust: add pin-init API core 2023-04-12 18:41:05 +02:00
prelude.rs rust: prelude: prevent doc inline of external imports 2023-01-16 23:49:46 +01:00
print.rs rust: print: avoid evaluating arguments in pr_* macros in unsafe blocks 2023-01-16 00:54:35 +01:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: std_vendor: add dbg! macro based on std's one 2022-12-04 01:59:16 +01:00
str.rs rust: str: add fmt! macro 2022-12-04 01:59:16 +01:00
sync.rs rust: sync: introduce UniqueArc 2023-01-16 23:48:06 +01:00
types.rs rust: types: add Opaque::raw_get 2023-04-12 18:41:05 +02:00