Skip to content

Commit

Permalink
lang-items: Collect trait functions that are lang items
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Dec 18, 2024
1 parent 5577e77 commit 3562b60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gcc/rust/ast/rust-collect-lang-items.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions gcc/rust/ast/rust-collect-lang-items.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T> void maybe_add_lang_item (const T &item);
Expand Down

0 comments on commit 3562b60

Please sign in to comment.