Round one, find candidates by dereferencing (and maybe an unsized coercion):
- &Foo
- Foo
Round two, add &T and &mut T after each T:
&Foo&&Foo&mut &FooFoo&Foo&mut Foo
Round three, find methods for the first of these with a receiver that matches:
-
&Foois the first and we find two receivers:-
Foo::methodreceives&Foo -
Trait::methodreceives&Foo
-
The first is an inherent method and it wins.