aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorTamir Duberstein <[email protected]>2025-04-23 13:54:37 +0000
committerAndreas Hindborg <[email protected]>2025-05-01 09:35:49 +0000
commit1a4736c3d8394f5e64557a41b4b2b8d6dcd04622 (patch)
tree89467c5abc9bdfb43df6a5b9763cfab9582fb260 /rust/helpers/helpers.c
parentLinux 6.15-rc3 (diff)
downloadkernel-1a4736c3d8394f5e64557a41b4b2b8d6dcd04622.tar.gz
kernel-1a4736c3d8394f5e64557a41b4b2b8d6dcd04622.zip
rust: types: add `ForeignOwnable::PointedTo`
Allow implementors to specify the foreign pointer type; this exposes information about the pointed-to type such as its alignment. This requires the trait to be `unsafe` since it is now possible for implementors to break soundness by returning a misaligned pointer. Encoding the pointer type in the trait (and avoiding pointer casts) allows the compiler to check that implementors return the correct pointer type. This is preferable to directly encoding the alignment in the trait using a constant as the compiler would be unable to check it. Acked-by: Danilo Krummrich <[email protected]> Signed-off-by: Tamir Duberstein <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andreas Hindborg <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions