[rust-dev] &self/&mut self in traits considered harmful(?)

Tommi rusty.gates at icloud.com
Thu Jun 12 10:59:51 PDT 2014


On 2014-06-12, at 20:51, Patrick Walton <pcwalton at mozilla.com> wrote:

> On 6/12/14 10:46 AM, Tommi wrote:
>> `Copy` types aren't really relevant to a discussion about adding to
>> Rust the C++ like optimization of moving rvalues (of non-Copy types)
>> when they're passed to certain functions.
> 
> There's nothing to add to Rust. Rust supports moves.

You're right, I said it wrong (the last part, not the `Copy` being irrelevant part). There's no need to add to the language the ability to move (obviously it has that), but perhaps there's a need to add the ability to not move certain arguments by default, for convenience. I wouldn't want to see generic code littered with explicit .clone()'s all over the place.



More information about the Rust-dev mailing list