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 9a561453d0ee..2193544a6640 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -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) { diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h index 557fa949b402..ce84cd392fea 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.h @@ -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;