From 0f42a240e53e932de0ae4799d54fe0bd15d06047 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Fri, 8 Jan 2021 16:49:06 +0000 Subject: Functions with parameters much receive their own scoping Rib This means that paramters are scoped and shadowed correctly. Currently the resolver is treating all paramters are shadowing each other if they have the same name which is incorrect. --- gcc/rust/resolve/rust-ast-resolve.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/rust/resolve/rust-ast-resolve.cc') diff --git a/gcc/rust/resolve/rust-ast-resolve.cc b/gcc/rust/resolve/rust-ast-resolve.cc index fe8d7e0..e5b0942 100644 --- a/gcc/rust/resolve/rust-ast-resolve.cc +++ b/gcc/rust/resolve/rust-ast-resolve.cc @@ -285,6 +285,9 @@ ResolveExpr::visit (AST::BlockExpr &expr) return true; }); + if (expr.has_tail_expr ()) + ResolveExpr::go (expr.get_tail_expr ().get (), expr.get_node_id ()); + resolver->get_name_scope ().pop (); resolver->get_type_scope ().pop (); } -- cgit v1.1