rust: sync: arc: Implement Arc<dyn Any + Send + Sync>::downcast()
authorAsahi Lina <lina@asahilina.net>
Mon, 3 Apr 2023 10:01:11 +0000 (19:01 +0900)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 10 Apr 2023 21:55:43 +0000 (23:55 +0200)
commit1edd03378e50ff1071004c80cb878e4bad73a68f
treeccd32bd6275976b743750e3c6aa454bcf4d906d0
parent39867fec2855cf37e5542dc6a972bce8ee191a9c
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>
rust/kernel/sync/arc.rs
rust/kernel/sync/arc/std_vendor.rs [new file with mode: 0644]