rust/src/libstd
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
..
collections libstd: use unboxed closures 2014-12-13 17:03:47 -05:00
comm Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
io rollup merge of #19710: steveklabnik/gh15449 2014-12-15 06:44:20 -08:00
num libstd: fix unit tests 2014-12-13 20:15:39 -05:00
path Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
rand Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
rt Rewrite threading infrastructure, introducing Thunk to represent 2014-12-14 04:21:56 -05:00
sync Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
sys Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
thread_local Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
time libstd: convert Duration binops to by value 2014-12-13 20:15:39 -05:00
ascii.rs libstd: use unboxed closures 2014-12-13 17:03:47 -05:00
bitflags.rs auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis 2014-12-15 22:11:44 +00:00
c_vec.rs Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
dynamic_lib.rs libstd: add missing imports 2014-12-13 17:03:48 -05:00
error.rs Utilize fewer reexports 2014-12-05 18:13:04 -05:00
failure.rs Utilize fewer reexports 2014-12-05 18:13:04 -05:00
fmt.rs core: remove the dead function fmt::argumentstr. 2014-12-08 09:14:21 +02:00
hash.rs /*! -> //! 2014-11-26 16:50:14 -08:00
lib.rs Rewrite threading infrastructure, introducing Thunk to represent 2014-12-14 04:21:56 -05:00
macros.rs Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
os.rs rollup merge of #19787: akiss77/fix-i8-c_char 2014-12-15 06:45:35 -08:00
prelude.rs rollup merge of #19326: huonw/safer-syntax 2014-11-26 16:50:12 -08:00
rtdeps.rs Fix spelling errors and capitalization. 2014-09-03 23:10:38 -04:00
task.rs rollup merge of #19710: steveklabnik/gh15449 2014-12-15 06:44:20 -08:00