diff --git a/gcc/rust/ast/rust-collect-lang-items.cc b/gcc/rust/ast/rust-collect-lang-items.cc index 308720ae69a..50d134a429f 100644 --- a/gcc/rust/ast/rust-collect-lang-items.cc +++ b/gcc/rust/ast/rust-collect-lang-items.cc @@ -82,5 +82,13 @@ CollectLangItems::visit (AST::TraitItemType &item) DefaultASTVisitor::visit (item); } +void +CollectLangItems::visit (AST::Function &item) +{ + maybe_add_lang_item (item); + + DefaultASTVisitor::visit (item); +} + } // namespace AST } // namespace Rust diff --git a/gcc/rust/ast/rust-collect-lang-items.h b/gcc/rust/ast/rust-collect-lang-items.h index 552648f04ed..1d021b1d9c5 100644 --- a/gcc/rust/ast/rust-collect-lang-items.h +++ b/gcc/rust/ast/rust-collect-lang-items.h @@ -47,6 +47,7 @@ class CollectLangItems : public DefaultASTVisitor void visit (AST::Trait &item) override; void visit (AST::TraitItemType &item) override; + void visit (AST::Function &item) override; private: template void maybe_add_lang_item (const T &item);