bors 0669a432a2 auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis
- The following operator traits now take their arguments by value: `Add`, `Sub`, `Mul`, `Div`, `Rem`, `BitAnd`, `BitOr`, `BitXor`, `Shl`, `Shr`. This breaks all existing implementations of these traits.

- The binary operation `a OP b` now "desugars" to `OpTrait::op_method(a, b)` and consumes both arguments.

- `String` and `Vec` addition have been changed to reuse the LHS owned value, and to avoid internal cloning. Only the following asymmetric operations are available: `String + &str` and `Vec<T> + &[T]`, which are now a short-hand for the "append" operation.

[breaking-change]

---

This passes `make check` locally. I haven't touch the unary operators in this PR, but converting them to by value should be very similar to this PR. I can work on them after this gets the thumbs up.

@nikomatsakis r? the compiler changes
@aturon r? the library changes. I think the only controversial bit is the semantic change of the `Vec`/`String` `Add` implementation.
cc #19148
2014-12-15 22:11:44 +00:00
..
2014-10-29 11:43:07 -04:00
2014-04-04 15:57:45 -07:00
2014-12-08 13:47:44 -05:00
2014-10-02 17:02:15 +03:00
2014-10-29 11:43:07 -04:00
2014-05-11 01:13:02 -07:00
2014-11-25 11:02:47 -08:00
2014-10-02 17:02:15 +03:00
2014-08-23 12:16:04 -07:00
2014-08-23 12:16:04 -07:00
2014-11-25 11:02:47 -08:00
2014-08-23 12:16:04 -07:00
2014-12-08 13:47:44 -05:00
2014-08-25 13:37:40 -07:00
2014-11-01 19:07:51 -07:00
2014-06-24 11:36:28 -07:00
2014-10-29 11:43:07 -04:00
2014-10-29 11:43:07 -04:00
2014-10-29 11:43:07 -04:00