Skip to content
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

Fix swapping of >>= and <<= in constants #850

Closed
wants to merge 2 commits into from

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented Jun 22, 2023

ShlEq is shift left equals, i.e. <<=, so it was previously mapped the wrong way.

syn::BinOp::ShlEq(..) => ">>=",
syn::BinOp::ShrEq(..) => "<<=",
syn::BinOp::ShlEq(..) => "<<=",
syn::BinOp::ShrEq(..) => ">>=",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but would there be any chance to add a test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon looking at this again, I don't think it is possible to use <<= in constants at all, since the left hand side must be a variable. So probably these cases could also be an unreachable!() instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this since it's trivial, it's not a big deal.

@emilio emilio closed this in aeea9c6 Aug 25, 2023
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.

None yet

3 participants