]> git.ipfire.org Git - thirdparty/gcc.git/commit
Allow multiple outer attributes on generic params
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 20 May 2024 10:00:11 +0000 (12:00 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Tue, 11 Jun 2024 15:53:17 +0000 (15:53 +0000)
commit2a1e169956f9faa13928eda3f146ea0cc770b864
tree141cfaa57d9b37d06f5cf28df31756a85e402bc8
parent50862befdb2c33ad6b71f0c4c8ce3d455c92cffd
Allow multiple outer attributes on generic params

Previously generic params only allowed one outer attribute in front of
them.

gcc/rust/ChangeLog:

* ast/rust-ast-collector.cc (TokenCollector::visit): Visit outer
attributes.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change outer
attribute visit, we need to visit all of them.
* ast/rust-ast.cc (LifetimeParam::as_string): Change as_string
implementation to allow multiple outer attributes.
(TypeParam::as_string): Likewise.
* ast/rust-ast.h (class LifetimeParam): Allow multiple outer
attributes.
* ast/rust-item.h (class TypeParam): Likewise.
* ast/rust-path.h: Likewise.
* parse/rust-parse-impl.h (Parser::parse_generic_param): Change call
to outer attribute parsing to collect several attributes.
(Parser::parse_lifetime_param): Likewise.
(Parser::parse_type_param): Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast-collector.cc
gcc/rust/ast/rust-ast-visitor.cc
gcc/rust/ast/rust-ast.cc
gcc/rust/ast/rust-ast.h
gcc/rust/ast/rust-item.h
gcc/rust/ast/rust-path.h
gcc/rust/parse/rust-parse-impl.h