Nah, it can pick one. It's just because traits are involved (and there are multiple deref targets to choose from, though it could just pick the first in the chain tbh) https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=00257fc8db0914a33c6e000a038111e8 …
Probably the biggest way that self is getting special cased here is that it won't try to deref self but it will try to deref other arguments (why is `PartialEq<Inner> for Outer` fine there but not `PartialEq<Outer> for Inner`?)
-
-
but your example is already asymmetric, it's breaking because `y` is MyRc, not because it's not self. It fails if you swap y with x, it has nothing to do with the receiver being special cased
-
What's happening is that for x it's managing to find a single impl that doesn't require coercion. it's done! it's able to coerce for y because there's a single impl, so all the expected types are known
- 9 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.