summaryrefslogtreecommitdiff
path: root/rust/kernel/lib.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2023-08-28 10:48:01 +0000
committerTejun Heo <tj@kernel.org>2023-09-25 09:46:41 -1000
commita8321776ca0b13ec4d4fc817144fe1b3f6ba4625 (patch)
treeae3da57a8aa504d6cea518e6306b8b42333f86cd /rust/kernel/lib.rs
parent6465e260f48790807eef06b583b38ca9789b6072 (diff)
downloadlinux-a8321776ca0b13ec4d4fc817144fe1b3f6ba4625.tar.gz
linux-a8321776ca0b13ec4d4fc817144fe1b3f6ba4625.tar.bz2
linux-a8321776ca0b13ec4d4fc817144fe1b3f6ba4625.zip
rust: sync: add `Arc::{from_raw, into_raw}`
These methods can be used to turn an `Arc` into a raw pointer and back, in a way that preserves the metadata for fat pointers. This is done using the unstable ptr_metadata feature [1]. However, it could also be done using the unstable pointer_byte_offsets feature [2], which is likely to have a shorter path to stabilization than ptr_metadata. Link: https://github.com/rust-lang/rust/issues/81513 [1] Link: https://github.com/rust-lang/rust/issues/96283 [2] Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Co-developed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'rust/kernel/lib.rs')
-rw-r--r--rust/kernel/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index e8811700239a..9f75d6f3d07b 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -16,6 +16,7 @@
#![feature(coerce_unsized)]
#![feature(dispatch_from_dyn)]
#![feature(new_uninit)]
+#![feature(ptr_metadata)]
#![feature(receiver_trait)]
#![feature(unsize)]