[rust-dev] &self/&mut self in traits considered harmful(?)
rusty.gates at icloud.com
Thu Jun 12 11:32:37 PDT 2014
For some reason I got really side-tracked here. The whole point of that `stable` keyword I proposed was not syntax sugar, but that it allows the implementor of such a trait to pass by reference when the operator shouldn't move the passed in argument(s). Like, when you multiply two matrices and the returned type is not the same size as neither of the arguments types, there's no point in modifying either of those arguments in place, but rather you need to allocate a new matrix.
More information about the Rust-dev