-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
&5i + 5i
compiles but 5i + &5i
or &5i == 5i
don't
#8895
Comments
Related to #4920. My proposal is to make I am also inclined to agree associated fns would be better than methods but it doesn't really make any difference to the question at hand, which is what the behavior should be when used as binary operators. |
Visiting for triage, still needs to be fixed. Proposed bug example: fn main() {
&5i + 5i;
5i + &5i;
&5i == 5i;
} |
cc me |
oh hey this went away with the introduction of by-value operator overloading traits |
Auto-borrowing or auto-dereferencing are confusing me here, but this feels somewhat weird and inconsistent.
I wonder why all the operator overloads need to implemented methods rather than associatied functions where all the operands could be equally unsurprising arguments and not half arguments, half method receivers, but I'm not sure how applicable that is to this nitpick.
The text was updated successfully, but these errors were encountered: