rust/src/libcoretest
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
..
fmt libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
num libcoretest: fix unit tests 2014-12-13 20:15:39 -05:00
any.rs Rename fail! to panic! 2014-10-29 11:43:07 -04:00
atomic.rs Register new snapshots 2014-10-10 22:09:49 -07:00
cell.rs libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
char.rs libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
clone.rs Extract tests from libcore to a separate crate 2014-06-29 15:57:21 -07:00
cmp.rs Remove Signed trait and add SignedInt trait 2014-11-13 03:46:03 +11:00
finally.rs libcoretest: fix fallout 2014-12-13 17:03:45 -05:00
iter.rs libcoretest: use tuple indexing 2014-12-13 20:04:41 -05:00
lib.rs libcoretest: fix fallout in unit tests 2014-12-13 17:03:45 -05:00
mem.rs Fix fallout 2014-12-03 10:41:48 -05:00
ops.rs Extract tests from libcore to a separate crate 2014-06-29 15:57:21 -07:00
option.rs libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
ptr.rs Remove a large amount of deprecated functionality 2014-10-19 12:59:40 -07:00
raw.rs Extract tests from libcore to a separate crate 2014-06-29 15:57:21 -07:00
result.rs libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00
slice.rs Test fixes and rebase conflicts 2014-11-26 16:50:13 -08:00
str.rs libcoretest: fix fallout in unit tests 2014-12-13 17:03:45 -05:00
tuple.rs libcoretest: remove unnecessary as_slice() calls 2014-12-06 19:05:58 -05:00