diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-06-28 15:54:12 +0200 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2023-07-07 13:46:54 +0000 |
commit | 241fcaeb554c2e6883cb6a321f948bf9a2ff225a (patch) | |
tree | a3986e31921819dfa47b585365c497257221d38a /gcc | |
parent | 925310c10f3d6c144b0775a56a4fa688e8088a93 (diff) | |
download | gcc-241fcaeb554c2e6883cb6a321f948bf9a2ff225a.zip gcc-241fcaeb554c2e6883cb6a321f948bf9a2ff225a.tar.gz gcc-241fcaeb554c2e6883cb6a321f948bf9a2ff225a.tar.bz2 |
collector: Fix remaining trait & extern issues
Fix remaining failing tests with trait and extern. Outer attributes were
missing and the semicolon did output on macro invocations.
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit): Fix
external item trailing semicolon and outer attributes.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-collector.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/ast/rust-ast-collector.cc b/gcc/rust/ast/rust-ast-collector.cc index 88a25f0..f1306e7 100644 --- a/gcc/rust/ast/rust-ast-collector.cc +++ b/gcc/rust/ast/rust-ast-collector.cc @@ -2097,8 +2097,10 @@ TokenCollector::visit (TraitItemConst &item) void TokenCollector::visit (TraitItemType &item) { + visit_items_as_lines (item.get_outer_attrs ()); auto id = item.get_identifier ().as_string (); indentation (); + push (Rust::Token::make (TYPE, item.get_locus ())); push (Rust::Token::make_identifier (Location (), std::move (id))); push (Rust::Token::make (SEMICOLON, Location ())); @@ -2220,6 +2222,7 @@ TokenCollector::visit (ExternalFunctionItem &function) push (Rust::Token::make (RETURN_TYPE, Location ())); visit (function.get_return_type ()); } + push (Rust::Token::make (SEMICOLON, Location ())); } void @@ -2234,8 +2237,7 @@ TokenCollector::visit (ExternBlock &block) push (Rust::Token::make_string (Location (), std::move (abi))); } - visit_items_as_block (block.get_extern_items (), - {Rust::Token::make (SEMICOLON, Location ())}); + visit_items_as_block (block.get_extern_items (), {}); } static std::pair<TokenId, TokenId> |