diff options
author | Asahi Lina <lina@asahilina.net> | 2023-04-03 19:01:11 +0900 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2023-04-10 23:55:43 +0200 |
commit | 1edd03378e50ff1071004c80cb878e4bad73a68f (patch) | |
tree | ccd32bd6275976b743750e3c6aa454bcf4d906d0 /rust/kernel/sync/arc.rs | |
parent | 39867fec2855cf37e5542dc6a972bce8ee191a9c (diff) |
rust: sync: arc: Implement Arc<dyn Any + Send + Sync>::downcast()
This mirrors the standard library's alloc::sync::Arc::downcast().
Based on the Rust standard library implementation, ver 1.62.0,
licensed under "Apache-2.0 OR MIT", from:
https://github.com/rust-lang/rust/tree/1.62.0/library/alloc/src
For copyright details, please see:
https://github.com/rust-lang/rust/blob/1.62.0/COPYRIGHT
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Link: https://lore.kernel.org/r/20230224-rust-arc-v2-1-5c97a865b276@asahilina.net
[ Moved `mod std_vendor;` up. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/sync/arc.rs')
-rw-r--r-- | rust/kernel/sync/arc.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index a94e303217c6..4ab9b280cb3d 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -30,6 +30,8 @@ use core::{ ptr::NonNull, }; +mod std_vendor; + /// A reference-counted pointer to an instance of `T`. /// /// The reference count is incremented when new instances of [`Arc`] are created, and decremented |