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

Tommi rusty.gates at icloud.com
Wed Jun 11 10:54:01 PDT 2014


If the `Mul` trait and similar were changed to take `self` by value, perhaps the following kind of language design would make more sense:

If a variable of a type that has a destructor is passed to a function by value (moved), and the variable is used after the function call, the variable would be implicitly cloned before passing it to the function.



More information about the Rust-dev mailing list