aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-07-18 16:16:12 +0100
committerPhilip Herron <philip.herron@embecosm.com>2022-07-18 16:18:02 +0100
commit3bf3ea88786c43f81064f913d62115a48aac9f44 (patch)
treeb1ab6903f8e9d5bb1d544f40b3b9fca5eee7ba22 /gcc/rust/ast
parent6920d2294b3c6f106478fd3decaa511faf3cac84 (diff)
downloadgcc-3bf3ea88786c43f81064f913d62115a48aac9f44.zip
gcc-3bf3ea88786c43f81064f913d62115a48aac9f44.tar.gz
gcc-3bf3ea88786c43f81064f913d62115a48aac9f44.tar.bz2
Ensure we parse any inner item attributes when expanding a module
When compiling code containing module expansions we must first ensure any possible inner item attributes are parser first and applied to the module, otherwise we end up in a bad state and ignore attributes. Fixes #1089
Diffstat (limited to 'gcc/rust/ast')
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index 25ec6db..cac816d 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -4056,6 +4056,8 @@ Module::load_items ()
Lexer lex (module_file.c_str (), std::move (file_wrap), linemap);
Parser<Lexer> parser (lex);
+ // we need to parse any possible inner attributes for this module
+ inner_attrs = parser.parse_inner_attributes ();
auto parsed_items = parser.parse_items ();
for (const auto &error : parser.get_errors ())
error.emit_error ();