linux-stable/rust/kernel
Benno Lossin a58f5fabca rust: types: make `Opaque` be `!Unpin`
[ Upstream commit 0b4e3b6f6b ]

Adds a `PhantomPinned` field to `Opaque<T>`. This removes the last Rust
guarantee: the assumption that the type `T` can be freely moved. This is
not the case for many types from the C side (e.g. if they contain a
`struct list_head`). This change removes the need to add a
`PhantomPinned` field manually to Rust structs that contain C structs
which must not be moved.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Link: https://lore.kernel.org/r/20230630150216.109789-1-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-08 14:09:04 +01:00
..
init rust: init: update macro expansion example in docs 2023-05-31 18:53:10 +02:00
sync rust: delete `ForeignOwnable::borrow_mut` 2023-08-04 17:10:50 +02:00
allocator.rs rust: allocator: Prevent mis-aligned allocation 2023-08-04 17:10:31 +02:00
build_assert.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
error.rs rust: error: fix the description for `ECHILD` 2023-10-25 12:16:28 +02:00
init.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
ioctl.rs rust: ioctl: Add ioctl number manipulation functions 2023-04-22 01:46:45 +02:00
lib.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
prelude.rs rust: introduce `current` 2023-04-22 00:20:00 +02:00
print.rs rust: kernel: Mark rust_fmt_argument as extern "C" 2023-04-06 23:11:04 +02:00
static_assert.rs rust: static_assert: add `static_assert!` macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
str.rs rust: str: add conversion from `CStr` to `CString` 2023-05-31 18:53:10 +02:00
sync.rs rust: sync: introduce `CondVar` 2023-04-22 01:46:45 +02:00
task.rs rust: task: add `Send` marker to `Task` 2023-05-31 18:53:10 +02:00
types.rs rust: types: make `Opaque` be `!Unpin` 2023-11-08 14:09:04 +01:00