From 5444ed27a8139d5d584859321a88cadaafdb1cb0 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Tue, 11 Apr 2023 18:11:09 +0200 Subject: [PATCH] gccrs: ast: Fix inner attribute tokenstream Inner attribute did not output exclamation tokens as there was no way to differentiate inner from outer attributes previously. gcc/rust/ChangeLog: * ast/rust-ast-tokenstream.cc (TokenStream::visit): Fix inner attribute tokenstream output. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-tokenstream.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/rust/ast/rust-ast-tokenstream.cc b/gcc/rust/ast/rust-ast-tokenstream.cc index 3e2fdfc9e7b3..d4e23bfec706 100644 --- a/gcc/rust/ast/rust-ast-tokenstream.cc +++ b/gcc/rust/ast/rust-ast-tokenstream.cc @@ -155,6 +155,8 @@ void TokenStream::visit (Attribute &attrib) { tokens.push_back (Rust::Token::make (HASH, attrib.get_locus ())); + if (attrib.is_inner_attribute ()) + tokens.push_back (Rust::Token::make (EXCLAM, Location ())); tokens.push_back (Rust::Token::make (LEFT_SQUARE, Location ())); visit (attrib.get_path ()); -- 2.47.2