*mut T
.
self: MyRc<T>
methods.trait Receiver
separate from Deref
because not all smart pointer types can support deref (for good reasons).dyn
(not covered in the RFC).Receiver
trait to identify method candidates. This allows fn foo(self: P<Self>)
for custom smart pointers.Receiver
for T: Deref
.Box::foo(self)
over fn foo(self: Box<Self>)
KernelArc<T>
) and cross-language interop (CppRef<T>
).Raw<T>: Receiver
in core to cover the unsafe Rust use-case.Box
) run the risk of shadowing existing methods on an inner type. Anyone implementing Deref
or Receiver
should not add methods, just like we don't add methods for Box
and friends. But this is not enforced.fn foo(self: Box<Self>)
over a foo
method defined on Box<T>
.KernelArc<T>
) and cross-language interop (CppRef<T>
).Raw<T>: Receiver
in core to cover the unsafe Rust use-case.Receiver
-resolved method like fn foo(P<Self>)
and some other method.KernelArc<T>
) and cross-language interop (CppRef<T>
).Raw<T>: Receiver
in core to cover the unsafe Rust use-case.*mut T
(and probably NonNull<T>
and Weak<T>
) implement Receiver
.NonNull
or Weak
again.P<Self>
method, we pick the method defined on the inner type and show a warning.*mut T
(and probably NonNull<T>
and Weak<T>
) implement Receiver
.NonNull
and Weak
though this would still require users to resolve warnings so we might still not want to.P<Self>
method, we silently pick the the method defined on the inner type.*mut T
(and probably NonNull<T>
and Weak<T>
) implement Receiver
.NonNull
and Weak
.fn foo(self: NewBox<MyType>)
while in parallel the crate that defines MyBox
adds a foo
method (the "race condition" scenario).