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-03-31 15:47:36 -07:00
2014-10-19 12:59:40 -07:00
2014-12-14 04:21:56 -05:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2014-05-24 21:48:10 -07:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2014-05-24 21:48:10 -07:00
2014-03-31 15:47:36 -07:00
2014-05-13 17:24:07 -07:00
2014-10-09 09:44:52 -07:00
2014-10-19 12:59:40 -07:00
2014-06-23 23:28:28 -07:00
2014-10-19 12:59:40 -07:00
2014-10-29 11:43:07 -04:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-29 23:24:04 -04:00
2014-10-21 23:52:00 -04:00
2014-10-19 12:59:40 -07:00
2014-07-05 12:46:42 -07:00
2014-07-05 12:46:42 -07:00
2014-07-05 12:46:42 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-06 15:55:43 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-06-12 18:39:01 +02:00
2014-04-14 21:00:31 +05:30
2014-05-24 21:48:10 -07:00
2014-10-16 11:15:34 -04:00
2014-04-14 21:00:31 +05:30
2014-08-20 21:02:24 -04:00
2014-10-19 12:59:40 -07:00
2014-10-09 17:19:53 -04:00
2014-04-04 15:57:45 -07:00
2014-05-30 15:52:24 -07:00
2014-04-20 13:41:18 +12:00
2014-11-11 15:06:54 -08:00
2014-10-19 12:59:40 -07:00
2014-09-13 02:07:39 -07:00
2014-10-19 12:59:40 -07:00
2014-12-08 13:47:44 -05:00
2014-10-02 17:02:15 +03:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-14 21:00:31 +05:30
2014-03-31 19:50:51 -07:00
2014-10-29 11:43:07 -04:00
2014-04-14 21:00:31 +05:30
2014-10-19 12:59:40 -07:00
2014-04-04 09:31:44 -07:00
2014-05-11 01:13:02 -07:00
2014-04-14 21:00:31 +05:30
2014-03-31 19:50:51 -07:00
2014-10-02 17:02:03 +03:00
2014-11-25 11:02:47 -08:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-04-27 20:35:51 -07:00
2014-10-02 17:02:15 +03:00
2014-08-27 21:46:52 -04:00
2014-03-31 19:50:51 -07:00
2014-11-20 00:56:50 +01:00
2014-06-29 11:47:58 -07:00
2014-06-24 17:18:48 -07:00
2014-03-31 19:50:51 -07:00
2014-03-31 19:50:51 -07:00
2014-05-06 16:45:21 -07:00
2014-08-23 12:16:04 -07:00
2014-11-03 15:08:20 -08:00
2014-04-14 21:00:31 +05:30
2014-04-10 15:22:00 -07:00
2014-04-10 15:22:00 -07:00
2014-09-30 16:22:55 +02:00
2014-04-16 11:42:22 -07:00
2014-04-16 11:42:22 -07:00
2014-08-23 12:16:04 -07:00
2014-10-09 09:44:52 -07:00
2014-08-23 12:16:04 -07:00
2014-04-30 19:24:21 -07:00
2014-11-25 11:02:47 -08:00
2014-08-23 12:16:04 -07:00
2014-05-27 09:04:08 -07:00
2014-12-08 13:47:44 -05:00
2014-08-25 12:48:35 -07:00
2014-08-25 13:37:40 -07:00
2014-08-25 05:01:51 -07:00
2014-09-30 23:53:15 +03:00
2014-10-09 09:44:52 -07:00
2014-10-09 09:44:52 -07:00
2014-11-01 19:07:51 -07:00
2014-11-01 15:24:42 -07:00
2014-11-18 12:32:38 -05:00
2014-12-12 03:38:11 +09:00
2014-04-14 21:00:31 +05:30
2014-12-08 13:47:44 -05:00
2014-06-09 17:46:53 -07:00
2014-08-30 09:12:04 +12:00
2014-10-19 12:59:40 -07:00
2014-06-24 11:36:28 -07:00
2014-11-05 17:35:40 -08:00
2014-11-12 09:18:35 -08:00
2014-10-29 11:43:07 -04:00
2014-04-14 21:00:31 +05:30
2014-10-19 12:59:40 -07:00
2014-04-14 21:00:31 +05:30
2014-10-30 19:02:11 -07:00
2014-10-30 19:02:11 -07:00
2014-12-08 13:47:44 -05:00
2014-12-08 13:47:44 -05:00
2014-04-14 21:00:31 +05:30
2014-11-20 00:56:50 +01:00
2014-11-20 00:56:50 +01:00
2014-04-14 21:00:31 +05:30
2014-04-14 21:00:31 +05:30
2014-09-22 20:05:45 -07:00
2014-07-19 13:10:58 -07:00
2014-08-20 21:02:23 -04:00
2014-11-23 23:37:16 -08:00
2014-09-22 20:05:45 -07:00
2014-08-14 13:24:50 -07:00
2014-03-31 18:59:46 -07:00
2014-03-31 15:47:36 -07:00
2014-08-14 13:24:50 -07:00
2014-10-29 11:43:07 -04:00
2014-07-10 07:51:50 -07:00
2014-10-28 15:55:37 +11:00
2014-09-05 09:18:57 -07:00
2014-09-05 09:18:57 -07:00
2014-09-05 09:18:57 -07:00
2014-11-07 12:04:28 -08:00
2014-11-07 12:04:28 -08:00
2014-09-17 18:53:54 +12:00
2014-10-19 12:59:40 -07:00
2014-10-29 11:43:07 -04:00
2014-04-14 21:00:31 +05:30
2014-11-20 00:56:50 +01:00
2014-11-20 00:56:50 +01:00
2014-03-31 15:47:36 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-10-19 12:59:40 -07:00
2014-11-03 15:08:20 -08:00
2014-11-03 15:08:20 -08:00
2014-08-17 01:39:10 -07:00
2014-08-23 12:16:04 -07:00
2014-10-19 12:59:40 -07:00
2014-03-31 15:47:36 -07:00
2014-03-31 15:47:36 -07:00
2014-12-13 20:15:39 -05:00
2014-08-07 08:54:38 -07:00
2014-12-14 11:11:55 -05:00
2014-11-18 12:32:38 -05:00
2014-04-16 08:12:43 -07:00
2014-10-31 20:43:35 -07:00
2014-10-29 11:43:07 -04:00
2014-08-14 14:14:26 -07:00
2014-11-17 07:35:51 -08:00
2014-06-17 11:44:00 -07:00
2014-06-28 11:53:58 -07:00
2014-07-04 17:07:31 -07:00
2014-12-08 13:47:44 -05:00