Skip to content

Commit

Permalink
Handle external static items in toplevel resolver 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): Handle ExternalStaticItem.
	* resolve/rust-toplevel-name-resolver-2.0.h
	(TopLevel::visit): Likewise.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 authored and CohenArthur committed Oct 24, 2024
1 parent e7de54d commit d222c93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ TopLevel::visit (AST::StaticItem &static_item)
Namespace::Values);
}

void
TopLevel::visit (AST::ExternalStaticItem &static_item)
{
insert_or_error_out (static_item.get_identifier ().as_string (), static_item,
Namespace::Values);
}

void
TopLevel::visit (AST::StructStruct &struct_item)
{
Expand Down
1 change: 1 addition & 0 deletions gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class TopLevel : public DefaultResolver
void visit (AST::Function &function) override;
void visit (AST::BlockExpr &expr) override;
void visit (AST::StaticItem &static_item) override;
void visit (AST::ExternalStaticItem &static_item) override;
void visit (AST::StructStruct &struct_item) override;
void visit (AST::TupleStruct &tuple_struct) override;
void visit (AST::EnumItem &variant) override;
Expand Down

0 comments on commit d222c93

Please sign in to comment.