linux/rust
Benno Lossin 0528ca0a4f rust: init: add assert_pinned macro
Add a macro to statically check if a field of a struct is marked with
`#[pin]` ie that it is structurally pinned. This can be used when
`unsafe` code needs to rely on fields being structurally pinned.

The macro has a special "inline" mode for the case where the type
depends on generic parameters from the surrounding scope.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Co-developed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20240814-linked-list-v5-1-f5f5e8075da0@google.com
[ Replaced `compile_fail` with `ignore` and a TODO note. Removed
  `pub` from example to clean `unreachable_pub` lint. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-08-23 06:25:59 +02:00
..
bindings rust: sort blk includes in bindings_helper.h 2024-08-21 00:37:02 +02:00
helpers rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
kernel rust: init: add assert_pinned macro 2024-08-23 06:25:59 +02:00
macros rust: module: add static pointer to {init,cleanup}_module() 2024-08-18 23:34:37 +02:00
uapi rust: allow dead_code for never constructed bindings 2024-07-10 10:28:51 +02:00
.gitignore
bindgen_parameters rust: Ignore preserve-most functions 2023-12-13 01:09:55 +01:00
build_error.rs
compiler_builtins.rs rust: add intrinsics to fix -Os builds 2024-08-10 00:05:10 +02:00
exports.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
Makefile rust: enable bindgen's --enable-function-attribute-detection flag 2024-08-21 00:37:02 +02:00