diff options
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r-- | gcc/rust/resolve/rust-early-name-resolver.cc | 6 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/rust/resolve/rust-early-name-resolver.cc b/gcc/rust/resolve/rust-early-name-resolver.cc index 5b701f5..cdebca6 100644 --- a/gcc/rust/resolve/rust-early-name-resolver.cc +++ b/gcc/rust/resolve/rust-early-name-resolver.cc @@ -20,6 +20,7 @@ #include "rust-ast-full.h" #include "rust-name-resolver.h" #include "rust-macro-builtins.h" +#include "rust-attribute-values.h" namespace Rust { namespace Resolver { @@ -29,7 +30,7 @@ static bool is_macro_use_module (const AST::Module &mod) { for (const auto &attr : mod.get_outer_attrs ()) - if (attr.get_path ().as_string () == "macro_use") + if (attr.get_path ().as_string () == Values::Attributes::MACRO_USE) return true; return false; @@ -973,7 +974,8 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc) bool is_builtin = std::any_of (outer_attrs.begin (), outer_attrs.end (), [] (AST::Attribute attr) { - return attr.get_path () == "rustc_builtin_macro"; + return attr.get_path () + == Values::Attributes::RUSTC_BUILTIN_MACRO; }); if (is_builtin) 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 f24c91d..486998d 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -19,6 +19,7 @@ #include "rust-toplevel-name-resolver-2.0.h" #include "rust-ast-full.h" #include "rust-hir-map.h" +#include "rust-attribute-values.h" namespace Rust { namespace Resolver2_0 { @@ -137,7 +138,7 @@ static bool is_macro_export (AST::MacroRulesDefinition &def) { for (const auto &attr : def.get_outer_attrs ()) - if (attr.get_path ().as_string () == "macro_export") + if (attr.get_path ().as_string () == Values::Attributes::MACRO_EXPORT) return true; return false; |