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 parenthesization of jumps in ranges #1798

Merged
merged 2 commits into from
Dec 26, 2024
Merged

Fix parenthesization of jumps in ranges #1798

merged 2 commits into from
Dec 26, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Dec 26, 2024

Previously, the syntax tree for (return)..=return (with paren flattened away) would get incorrectly turned into return ..=return which means a different thing.

This syntax tree incorrectly gets turned into `return ..=return` when
printed, which is a return whose value is a RangeToInclusive. The
original is a Range whose endpoints are returns.
@dtolnay dtolnay merged commit 560dd9d into master Dec 26, 2024
30 checks passed
@dtolnay dtolnay deleted the jumpinrange branch December 26, 2024 05:29
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.

1 participant