summaryrefslogtreecommitdiff
path: root/rust/helpers/xarray.c
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-04-23 09:54:37 -0400
committerAndreas Hindborg <a.hindborg@kernel.org>2025-05-01 11:35:49 +0200
commit1a4736c3d8394f5e64557a41b4b2b8d6dcd04622 (patch)
tree89467c5abc9bdfb43df6a5b9763cfab9582fb260 /rust/helpers/xarray.c
parent9c32cda43eb78f78c73aee4aa344b777714e259b (diff)
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 <dakr@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250423-rust-xarray-bindings-v19-1-83cdcf11c114@gmail.com Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Diffstat (limited to 'rust/helpers/xarray.c')
0 files changed, 0 insertions, 0 deletions