Skip to content

Parse and lower let-else statements #3468

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 5 commits into from
Mar 25, 2025

Conversation

CohenArthur
Copy link
Member

Fixes #3459
Fixes #3460

gcc/rust/ChangeLog:

	* ast/rust-stmt.h (class LetStmt): Add optional expression for diverging else.
	* ast/rust-ast-builder.cc (Builder::let): Use new API.
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_let_stmt): Add new parsing in case of `else` token.
gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): Add handling for diverging else
	expression.
gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-stmt.h: Add handling for diverging else.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Likewise.
gcc/rust/ChangeLog:

	* hir/tree/rust-hir-stmt.h (class LetStmt): Add optional diverging else expression.
	* hir/tree/rust-hir-stmt.cc: Likewise.
	* hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::visit): Add handling for lowering
	diverging else.
@CohenArthur CohenArthur added this pull request to the merge queue Mar 25, 2025
Merged via the queue into Rust-GCC:master with commit f608c02 Mar 25, 2025
12 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.

Lower let-else statements properly Parse let-else statements
2 participants