aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2024-11-11 16:19:44 -0500
committerCohenArthur <arthur.cohen@embecosm.com>2024-11-14 16:39:02 +0000
commit41a12471b514e45d5f94d3a58b569ae8996c2501 (patch)
tree3292019ec43c12b8cd311045383f1bfb83e1fab2 /gcc
parenteda3bfdd8296494f32d2598d59c9276f30b84400 (diff)
downloadgcc-41a12471b514e45d5f94d3a58b569ae8996c2501.zip
gcc-41a12471b514e45d5f94d3a58b569ae8996c2501.tar.gz
gcc-41a12471b514e45d5f94d3a58b569ae8996c2501.tar.bz2
Improve handling of static items in toplevel 2.0
gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Use DefaultResolver::visit and avoid a call to Identifier::as_string while handling instances of StaticItem. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
index badaaed..01c5d26 100644
--- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
+++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
@@ -241,13 +241,10 @@ TopLevel::visit (AST::BlockExpr &expr)
void
TopLevel::visit (AST::StaticItem &static_item)
{
- auto sub_vis
- = [this, &static_item] () { static_item.get_expr ().accept_vis (*this); };
-
- ctx.scoped (Rib::Kind::Item, static_item.get_node_id (), sub_vis);
-
- insert_or_error_out (static_item.get_identifier ().as_string (), static_item,
+ insert_or_error_out (static_item.get_identifier (), static_item,
Namespace::Values);
+
+ DefaultResolver::visit (static_item);
}
void