From bdd43547d2b2f416531650da24920059b5a0bb96 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 12 Sep 2023 10:58:24 +0200 Subject: [PATCH] early: Fix use of new API and attribute resolution --- gcc/rust/resolve/rust-early-name-resolver-2.0.cc | 6 ++++-- gcc/rust/resolve/rust-early-name-resolver-2.0.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc index ba8cf78f2c7b..53ccc060e59a 100644 --- a/gcc/rust/resolve/rust-early-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.cc @@ -204,7 +204,8 @@ Early::visit_attributes (std::vector &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 @@ -226,7 +227,8 @@ Early::visit_attributes (std::vector &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 diff --git a/gcc/rust/resolve/rust-early-name-resolver-2.0.h b/gcc/rust/resolve/rust-early-name-resolver-2.0.h index 96ec724715aa..ba9f9585cd8c 100644 --- a/gcc/rust/resolve/rust-early-name-resolver-2.0.h +++ b/gcc/rust/resolve/rust-early-name-resolver-2.0.h @@ -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 &attrs);