From: Pierre-Emmanuel Patry Date: Tue, 11 Apr 2023 16:11:09 +0000 (+0200) Subject: gccrs: ast: Fix inner attribute tokenstream X-Git-Tag: basepoints/gcc-15~2671 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5444ed27a8139d5d584859321a88cadaafdb1cb0;p=thirdparty%2Fgcc.git 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 --- 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 ());