From: "lenny.chiadmi-delage" <[email protected]>

added error handling for let else expression.

Fixes Rust-GCC/gccrs#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 <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/e9587f8b780219137a115e2e813084be8ae47f90

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4378

 gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc 
b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
index 1de0ad3a8..05b2b56b0 100644
--- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc
@@ -119,7 +119,7 @@ Late::visit (AST::LetStmt &let)
   ctx.bindings.exit ();
 
   if (let.has_else_expr ())
-    visit (let.get_init_expr ());
+    visit (let.get_else_expr ());
 
   // how do we deal with the fact that `let a = blipbloup` should look for a
   // label and cannot go through function ribs, but `let a = blipbloup()` can?

base-commit: 23de527f9c7b608b9e242328c0b7fbcf4667b545
-- 
2.52.0

Reply via email to