Skip to content

Iterators WORKING #2604

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

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Iterators WORKING #2604

merged 1 commit into from
Sep 4, 2023

Conversation

philberty
Copy link
Member

@philberty philberty commented Sep 4, 2023

We were massing the match scruitinee expression as a way to access the result of the expression. This is wrong and needs to be stored in a temporary otherwise it will cause the code to be regnerated for each time it is used. This is not an issue in the case where the expression is only used once.

Fixes #1895

@philberty philberty added this to the GCC 14 Stage 3 milestone Sep 4, 2023
@philberty philberty self-assigned this Sep 4, 2023
We were massing the match scruitinee expression as a way to access the
result of the expression. This is wrong and needs to be stored in a
temporary otherwise it will cause the code to be regnerated for each time
it is used. This is not an issue in the case where the expression is only
used once.

Fixes #1895

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::visit): use a temp for the value

gcc/testsuite/ChangeLog:

	* rust/execute/torture/iter1.rs: New test.

Signed-off-by: Philip Herron <[email protected]>
@philberty philberty added this pull request to the merge queue Sep 4, 2023
Merged via the queue into master with commit fe9e3ef Sep 4, 2023
@philberty philberty deleted the phil/iter-dev branch September 17, 2023 12:44
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.

Support Iterators
1 participant