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 RangeFromExpr parsing in for loop #2672

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented Oct 10, 2023

RangeFromExpr were not parsed correctly in for loop.

Fixes #2660
Fixes #2658

@P-E-P P-E-P added this to the GCC 14.1 release milestone Oct 10, 2023
@P-E-P P-E-P requested a review from CohenArthur October 10, 2023 11:22
@P-E-P P-E-P self-assigned this Oct 10, 2023
@P-E-P P-E-P marked this pull request as ready for review October 10, 2023 11:22
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM

@philberty
Copy link
Member

One you flx the conflics letsmerge it @P-E-P

P-E-P added 3 commits October 17, 2023 13:53
Those ranges were looking for a curly brace after the brace, leading
to an error when using range from expr in for loops.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_expr): Fix range from expr.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Add a new test to highlight the fix made for Rust-GCC#2660.

gcc/testsuite/ChangeLog:

	* rust/compile/range_from_expr_for_loop.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
Add a new test to highlight fix of Rust-GCC#2658.

gcc/testsuite/ChangeLog:

	* rust/compile/while_break_expr.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P force-pushed the fix-for-no-upper-bound branch from 75b803e to f08674d Compare October 17, 2023 11:53
@P-E-P P-E-P enabled auto-merge October 17, 2023 12:42
@P-E-P P-E-P added this pull request to the merge queue Oct 17, 2023
Merged via the queue into Rust-GCC:master with commit 0abe96a Oct 17, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Range with no upper bound not parsed correctly Cannot parse while break
2 participants