why can't I compare a &str to a Rc<String>
-
-
right, if there's a common trait target both are aiming for, I imagine it's really ambiguous which common type the compiler would make both deref to in order to make the trait work
-
It's not ambiguous at all (if it was, &* wouldn't work either). The impls don't even have to be related, there just has to be more than one of them.
- 1 more reply
New conversation -
-
-
basically, http://foo.bar () - style autoderef works in generic situations, but the kind of autoderef where &*** is automatically applied to things to coerce them is far more limited: if it's generic (or even if relying too heavily on inference) it won't work
-
Yup, which is kinda silly because the same rules used to decide which type is the receiver of `.bar` can be applied whenever `&` is used for argument passing
- 6 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.