Skip to content

Commit d63c230

Browse files
committed
rust: arc: add DispatchFromDyn<ArcBorrow<'_, U>> for ArcBorrow<'_, T>
This is part of the effort to minimize the differences of the `rust` branch with respect to mainline in order to eventually drop it. It is required to make the (fixed) examples compile. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 351cc13 commit d63c230

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rust/kernel/sync/arc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,13 @@ pub struct ArcBorrow<'a, T: ?Sized + 'a> {
436436
// This is to allow [`ArcBorrow`] (and variants) to be used as the type of `self`.
437437
impl<T: ?Sized> core::ops::Receiver for ArcBorrow<'_, T> {}
438438

439+
// This is to allow `ArcBorrow<U>` to be dispatched on when `ArcBorrow<T>` can be coerced into
440+
// `ArcBorrow<U>`.
441+
impl<T: ?Sized + Unsize<U>, U: ?Sized> core::ops::DispatchFromDyn<ArcBorrow<'_, U>>
442+
for ArcBorrow<'_, T>
443+
{
444+
}
445+
439446
impl<T: ?Sized> Clone for ArcBorrow<'_, T> {
440447
fn clone(&self) -> Self {
441448
*self

0 commit comments

Comments
 (0)