Skip to content

Make unary operators take their arguments by value #19899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 19, 2014

Conversation

japaric
Copy link
Member

@japaric japaric commented Dec 16, 2014

  • The following operator traits now take their argument by value: Neg, Not. This breaks all existing implementations of these traits.
  • The unary operation OP a now "desugars" to OpTrait::op_method(a) and consumes its argument.

[breaking-change]


r? @nikomatsakis This PR is very similar to the binops-by-value PR
cc @aturon

@aturon
Copy link
Member

aturon commented Dec 16, 2014

Lib changes LGTM.

@nikomatsakis nikomatsakis self-assigned this Dec 16, 2014
@nikomatsakis
Copy link
Contributor

r=me modulo the nit regarding the typeck module

@japaric
Copy link
Member Author

japaric commented Dec 17, 2014

re-r? @nikomatsakis

bors added a commit that referenced this pull request Dec 19, 2014
- The following operator traits now take their argument by value: `Neg`, `Not`. This breaks all existing implementations of these traits.

- The unary operation `OP a` now "desugars" to `OpTrait::op_method(a)` and consumes its argument.

[breaking-change]

---

r? @nikomatsakis This PR is very similar to the binops-by-value PR
cc @aturon
@bors bors merged commit 9b5de39 into rust-lang:master Dec 19, 2014
@japaric japaric deleted the unops-by-value branch December 20, 2014 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants