rust: sync: add support for dispatching on Arc and ArcBorrow.
authorWedson Almeida Filho <wedsonaf@gmail.com>
Wed, 28 Dec 2022 06:03:46 +0000 (06:03 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 16 Jan 2023 22:48:06 +0000 (23:48 +0100)
commit0748424aba89811b85e6e0f958b8ccd47f5af47e
tree6ec2c6bbedcda88ba9db638df158a570feaf6925
parent70e42ebbf6416e8005d8e08ae521b7d5cc5a8b3a
rust: sync: add support for dispatching on Arc and ArcBorrow.

Trait objects (`dyn T`) require trait `T` to be "object safe". One of
the requirements for "object safety" is that the receiver have one of
the allowed types. This commit adds `Arc<T>` and `ArcBorrow<'_, T>` to
the list of allowed types.

Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Acked-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/lib.rs
rust/kernel/sync/arc.rs