why can't I compare a &str to a Rc<String>
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.
-
-
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=216887fb1dc286b33dd9a6ebfee729fe … Only one valid type can be deref'd to, there's no ambiguity. It's just because the compiler chooses not to autoderef to satisfy traits (which I suspect has a good reason, but I've always seen as relatively arbitrary)
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.