On Thu, Apr 17, 2014 at 04:29:42AM -0700, Eduard Burtescu wrote:
> Wouldn't that make `Rc`'s `.clone()` method much harder to use (and this is just one example)?

Yes, you would have to write either `Clone::clone(&rc)` or
`Rc::clone(&rc)`, I think, to clone the RC wrapper. Which is
unfortunate, since cloning the RC wrapper is a common operation. This
is the one interaction that's been stopping me from writing this
proposal out.

The fact is, though, that autoderef and traits like `Clone` and `Eq`,
which are implemented on almost every type, are a known hazard. They
frequently don't do what you want.

I haven't had time to think about it much yet, but I was thinking it'd
be nice to have a kind of compromise, that allows a smart pointer
(like `Rc`) to declare a fixed set of methods (and maybe fields) that
it exports and which explicitly override the referent. `clone()` for
`Rc` might be an example. This would probably be done by declaring a
version of clone using an interior method. But this whole issue is
separate from this proposal anyway.