]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Output inner attributes in tokenstreams
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 4 Apr 2023 10:50:25 +0000 (12:50 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:43 +0000 (18:28 +0100)
Inner attributes were not correctly visited.

gcc/rust/ChangeLog:

* ast/rust-ast-tokenstream.cc (TokenStream::visit): Add call to
inner attribute visitor.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-tokenstream.cc

index 4a7107fbbbb9bb8063d9c8ac5ae2d1980f8d22f0..450767d336c77ad0bb4ad31c906cfc868d57f15b 100644 (file)
@@ -1255,6 +1255,7 @@ TokenStream::visit (BlockExpr &expr)
   tokens.push_back (Rust::Token::make (LEFT_CURLY, expr.get_locus ()));
   newline ();
   increment_indentation ();
+  visit_items_as_lines (expr.get_inner_attrs ());
 
   visit_items_as_lines (expr.get_statements (),
                        {Rust::Token::make (SEMICOLON, Location ())});