Dispatch for-loop desugar properly#3999
Merged
Merged
Conversation
powerboat9
reviewed
Jul 22, 2025
| } | ||
|
|
||
| Expr::Kind get_expr_kind () const override { return Expr::Kind::Return; } | ||
| Expr::Kind get_expr_kind () const override { return Expr::Kind::Try; } |
philberty
approved these changes
Jul 22, 2025
philberty
left a comment
Member
There was a problem hiding this comment.
LGTM but what is expression yeast? Does it go in bread? lol
Member
Author
the yeast eats all of the sugar and this visitor takes care of all the desugars 👀 |
90939a6 to
3227307
Compare
gcc/rust/ChangeLog: * ast/rust-desugar-for-loops.h: Adapt API and remove visitor. * ast/rust-desugar-for-loops.cc: Likewise. * ast/rust-expression-yeast.cc: Call DesugarForLoop. * ast/rust-expression-yeast.h: Declare dispatch_loops function. * rust-session-manager.cc (Session::expansion): Do not call for-loop desugar.
gcc/rust/ChangeLog: * ast/rust-desugar-question-mark.cc (DesugarQuestionMark::go): Add assertion for the expr's type. * ast/rust-desugar-try-block.cc (DesugarTryBlock::go): Likewise.
gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc: Add rust_unreachable() when lowering desugared exprs. * hir/rust-ast-lower-base.h: Mention this. * hir/rust-ast-lower-block.h: Remove existing definitions. * hir/rust-ast-lower-expr.cc: Likewise. * hir/rust-ast-lower-expr.h: Likewise. * hir/rust-ast-lower.cc: Likewise.
gcc/rust/ChangeLog: * ast/rust-desugar-for-loops.cc: Remove functions implemented in AST::Builder. * ast/rust-desugar-for-loops.h: Likewise.
3227307 to
144dceb
Compare
auto-merge was automatically disabled
July 31, 2025 11:03
Pull Request is not mergeable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.