-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Implement OpAssign traits with references on the right hand side #32094
Comments
By not providing |
Creates inconsistencies between x = x / y and x /= y, requiring an unnecessary dereference for iteration: https://is.gd/DIyCYY |
@nodakai Then generic code can only handle either of them, but not both. |
This was attempted in #41336 but unfortunately it caused too much breakage, so I'm going to close. |
Heads up for future readers, this was fixed in Rust 1.22.0. |
AddAssign
and the others are only implemented for equal right hand side arguments.AddAssign<u32> for u32
works well for integers, but the by reference Rhs implementation is important too, so that bigints and other non-Copy data types can have some interface in common with the primitive number types.The text was updated successfully, but these errors were encountered: