diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index b03d84f7ce87..ace478442998 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -264,6 +264,12 @@ fn deref(&self) -> &Self::Target { } } +impl AsRef for Arc { + fn as_ref(&self) -> &T { + self.deref() + } +} + impl Clone for Arc { fn clone(&self) -> Self { // INVARIANT: C `refcount_inc` saturates the refcount, so it cannot overflow to zero.