Skip to content

Commit

Permalink
early: Fix use of new API and attribute resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Sep 21, 2023
1 parent 77a53da commit 973d74e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gcc/rust/resolve/rust-early-name-resolver-2.0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
auto traits = attr.get_traits_to_derive ();
for (auto &trait : traits)
{
auto definition = ctx.macros.resolve_path (trait.get ());
auto definition
= ctx.macros.resolve_path (trait.get ().get_segments ());
if (!definition.has_value ())
{
// FIXME: Change to proper error message
Expand All @@ -226,7 +227,8 @@ Early::visit_attributes (std::vector<AST::Attribute> &attrs)
->lookup_builtin (name)
.is_error ()) // Do not resolve builtins
{
auto definition = ctx.macros.resolve_path (attr.get_path ());
auto definition
= ctx.macros.resolve_path (attr.get_path ().get_segments ());
if (!definition.has_value ())
{
// FIXME: Change to proper error message
Expand Down
2 changes: 2 additions & 0 deletions gcc/rust/resolve/rust-early-name-resolver-2.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class Early : public DefaultResolver
void visit (AST::Module &) override;

void visit (AST::MacroInvocation &) override;
void visit (AST::Function &) override;
void visit (AST::StructStruct &) override;

private:
void visit_attributes (std::vector<AST::Attribute> &attrs);
Expand Down

0 comments on commit 973d74e

Please sign in to comment.