Skip to content

Dispatch for-loop desugar properly#3999

Merged
CohenArthur merged 4 commits into
Rust-GCC:masterfrom
CohenArthur:dispatch-for-loops
Jul 31, 2025
Merged

Dispatch for-loop desugar properly#3999
CohenArthur merged 4 commits into
Rust-GCC:masterfrom
CohenArthur:dispatch-for-loops

Conversation

@CohenArthur

Copy link
Copy Markdown
Member

No description provided.

Comment thread gcc/rust/ast/rust-expr.h Outdated
}

Expr::Kind get_expr_kind () const override { return Expr::Kind::Return; }
Expr::Kind get_expr_kind () const override { return Expr::Kind::Try; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Dang

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but what is expression yeast? Does it go in bread? lol

@CohenArthur

Copy link
Copy Markdown
Member Author

LGTM but what is expression yeast? Does it go in bread? lol

the yeast eats all of the sugar and this visitor takes care of all the desugars 👀

@CohenArthur CohenArthur added this pull request to the merge queue Jul 24, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jul 24, 2025
@CohenArthur CohenArthur enabled auto-merge July 31, 2025 09:28
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.
@CohenArthur CohenArthur added this pull request to the merge queue Jul 31, 2025
auto-merge was automatically disabled July 31, 2025 11:03

Pull Request is not mergeable

Merged via the queue into Rust-GCC:master with commit 6959a07 Jul 31, 2025
13 checks passed
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.

3 participants