Skip to content

Clarify operand evaluation order in compound assignment with primitiv… #1941

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fiveseven-lambda
Copy link

@fiveseven-lambda fiveseven-lambda commented Jul 22, 2025

…e vs generic types

Closes #1940.

This PR improves the clarity of the compound assignment expression documentation by specifying that the right-before-left evaluation order only applies to non-generic code involving primitive types. In generic contexts (even with primitive types), the left operand is evaluated before the right, following trait dispatch rules.

Note: This pull request was drafted with the assistance of an AI language model (ChatGPT), then reviewed and edited by a human contributor for accuracy.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify operand evaluation order for a += b with primitive vs generic types
2 participants