Skip to content

Conversation

@Villosse
Copy link
Contributor

Fixes #4375

This PR resolve the ice on let else expression

For now, it does not follow the rustc behavior as it list all let else related error instead of stopping at the first one.

I also added some tests

@Villosse Villosse marked this pull request as ready for review January 14, 2026 14:40
@Villosse Villosse marked this pull request as draft January 14, 2026 14:50
@Villosse Villosse force-pushed the 4375 branch 4 times, most recently from 0a4b15a to 5d4cf09 Compare January 16, 2026 11:54
@Villosse Villosse marked this pull request as ready for review January 16, 2026 14:14
added error handling for let else expression.

Fixes Rust-GCC#4375

gcc/rust/ChangeLog:

	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Visit
	else_expr if has_else_expr, not init_expr.

Signed-off-by: lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
Added new tests.

Addresses Rust-GCC#4375

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4375-ice-regression.rs: New test.
	* rust/compile/issue-4375-multiple-errors.rs: New test.
	* rust/compile/issue-4375-tuple-pattern.rs: New test.

Signed-off-by: lenny.chiadmi-delage <lenny.chiadmi-delage@epita.fr>
@P-E-P P-E-P added this pull request to the merge queue Jan 16, 2026
Merged via the queue into Rust-GCC:master with commit b625de4 Jan 16, 2026
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.

ICE on let-else expr, should not give ICE, just parsing Error

2 participants