Skip to content

Commit

Permalink
Improve handling of static items in toplevel 2.0
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
powerboat9 committed Nov 11, 2024
1 parent 977a72c commit 7ead83f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ead83f

Please sign in to comment.