rust/src/libsyntax
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
..
ast_map Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
diagnostics libsyntax: use unboxed closures 2014-12-13 17:03:47 -05:00
ext auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis 2014-12-15 22:11:44 +00:00
parse auto merge of #19742 : vhbit/rust/copy-for-bitflags, r=alexcrichton 2014-12-15 00:07:35 +00:00
print Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
util libsyntax: use unboxed closures 2014-12-13 17:03:47 -05:00
abi.rs librustc: Make Copy opt-in. 2014-12-08 13:47:44 -05:00
ast.rs Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
ast_util.rs auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakis 2014-12-15 22:11:44 +00:00
attr.rs libsyntax: use unboxed closures 2014-12-13 17:03:47 -05:00
codemap.rs libsyntax: convert BytePos/CharPos binops to by value 2014-12-13 20:15:39 -05:00
config.rs Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
diagnostic.rs libsyntax: use unboxed closures 2014-12-13 17:03:47 -05:00
feature_gate.rs Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
fold.rs Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00
lib.rs libsyntax: fix fallout 2014-12-13 17:03:44 -05:00
owned_slice.rs libsyntax: fix fallout 2014-12-13 17:03:44 -05:00
ptr.rs libsyntax: use unboxed closures 2014-12-13 17:03:47 -05:00
show_span.rs rebasing fixes 2014-09-17 16:53:20 +12:00
std_inject.rs Remove libnative 2014-11-20 17:19:13 -08:00
test.rs Rename FnStyle trait to Unsafety. 2014-12-14 11:11:55 -05:00
visit.rs Parse unsafe impl but don't do anything particularly interesting with the results. 2014-12-14 11:11:55 -05:00