gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc:
Include rust-attribute-values.h.
(Early::visit): If a module has a macro_use attribute, avoid
pushing a new textual macro scope.
gcc/testsuite/ChangeLog:
* rust/compile/nr2/exclude: Remove entries.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
#include "rust-toplevel-name-resolver-2.0.h"
#include "rust-attributes.h"
#include "rust-finalize-imports-2.0.h"
+#include "rust-attribute-values.h"
namespace Rust {
namespace Resolver2_0 {
void
Early::visit (AST::Module &module)
{
- textual_scope.push ();
+ bool is_macro_use = false;
+
+ for (const auto &attr : module.get_outer_attrs ())
+ {
+ if (attr.get_path ().as_string () == Values::Attributes::MACRO_USE)
+ {
+ is_macro_use = true;
+ break;
+ }
+ }
+
+ if (!is_macro_use)
+ textual_scope.push ();
DefaultResolver::visit (module);
- textual_scope.pop ();
+ if (!is_macro_use)
+ textual_scope.pop ();
}
void
macros/mbe/macro43.rs
macros/mbe/macro44.rs
macros/mbe/macro6.rs
-macros/mbe/macro_use1.rs
multiple_bindings1.rs
multiple_bindings2.rs
-nested_macro_use1.rs
nested_macro_use2.rs
-nested_macro_use3.rs
not_find_value_in_scope.rs
privacy5.rs
privacy8.rs